urgent commit

This commit is contained in:
2025-05-19 09:54:23 +02:00
parent 4a8c4fdc2c
commit 8f9f4088fd
17 changed files with 1032 additions and 251 deletions

View File

@@ -2,12 +2,12 @@ if __name__ == "__main__":
liste1 = [12,1,20,5,23,8,29,10]
liste2 = [23,5,19,11,18,20,29,1,5,10,8]
def recherche_naive(l1, l2):
if not l1 or not l2:
return []
if l1[0] == l2[0]:
return [l1[0]] + recherche_naive(l1[1:], l2[1:])
else:
seq1 = recherche_naive(l1[1:], l2)
seq2 = recherche_naive(l1, l2[1:])
return seq1 if len(seq1) >= len(seq2) else seq2
def recherche(l1, l2):
ln1 = len(l1)
ln2 = len(l2)
if ln1>ln2:
for element in l2:
t = True
while t:
b = l1[index(element)]