Skip to content
Snippets Groups Projects
Commit e60ec8cf authored by Loic Scoth's avatar Loic Scoth
Browse files

fin de séance

parent b814c420
Branches
No related tags found
No related merge requests found
......@@ -6,9 +6,40 @@ class node() :
self.kmin=kmin
self.kmax=kmax
#def search(key) :
def dicho(listKeys,key) :
t=len(listKeys)-1
d, f = 0, t
if (listKeys[f] == key) :
return (True,f)
elif (d < t and listKeys[d] == key) :
return (True, d)
while (f-d > 1) :
m=(d+f)//2
if (listKeys[m]>=key):
f=m
if ( f< t and listKeys[f] == key) :
return (True,f)
else :
d=m
if (d < t and listKeys[d] == key) :
return (True, d)
return (False,0)
#def getSizeNode() :
#def getPos() :
#def setNewChild() :
#def removeChild() :
#def getSize() :
def getSize(listKey) :
return len(listKey)
#def isLeaf() :
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment