tc_info:2020_cpp-6-4

def $palindrome(L)$:
$\;\;\;\;$ return $palin(L,\, 0,\, len(L)$

def $palin(L,\, deb,\, fin)$:
$\;\;\;\;$ if $fin -deb \leq 1$:
$\;\;\;\;\;\;\;\;$ return True
$\;\;\;\;$ return $(L[deb] == L[fin-1])$ and $palin(L,\, deb + 1,\, fin -1)$

  • tc_info/2020_cpp-6-4.txt
  • Dernière modification : 2020/10/01 09:57
  • de pprea