Merge branch 'master' of githubu:GeoffreyFrogeye/tp-info
This commit is contained in:
commit
9fee682f5e
2
S2/TP4/.gitignore
vendored
Normal file
2
S2/TP4/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
lexique*
|
||||
anagrammes.txt
|
|
@ -49,10 +49,25 @@ def seqTrie(l, a, b, x): # Jean-loup
|
|||
return None
|
||||
|
||||
def dicho(l, a, b, x): # Geoffrey
|
||||
return None
|
||||
"""
|
||||
list, int, int, a → (bool, int)
|
||||
Renvoie la position d'un élément x dans la liste l
|
||||
aux bornes a et b par dichotomie.
|
||||
"""
|
||||
a = d
|
||||
f = b - 1
|
||||
while d < f:
|
||||
m = (d+f)//2
|
||||
if l[m] < x:
|
||||
d = m+1
|
||||
else:
|
||||
f = m
|
||||
return x == l[d]
|
||||
|
||||
question(2) # Utiliser LEXIQUE
|
||||
|
||||
from lexique import *
|
||||
|
||||
squestion('a') # Vérifier que LEXIQUE est triée
|
||||
|
||||
squestion('b') # Effectuer de nombreuses recherches de LEXIQUE
|
||||
|
|
Reference in a new issue