Recherche dans une skiplist en java

cs_ajadarti Messages postés 4 Date d'inscription dimanche 20 janvier 2008 Statut Membre Dernière intervention 13 mai 2010 - 14 oct. 2009 à 13:37
Arto_8000 Messages postés 1044 Date d'inscription lundi 7 mars 2005 Statut Membre Dernière intervention 13 juillet 2010 - 14 oct. 2009 à 16:21
Bonjour mes collegues
ça fait long temps que j'ai pas code en java et maintenant j'ai besoin de traduire un algorithme qlq peu m'aider à le traduire en java:
voilà l'algorithme:

Search(list, searchKey)
x := list?header
-- loop invariant: x?key < searchKey
for i := list?level downto 1 do
while x?forward[i]?key < searchKey do
x := x?forward[i]
-- x?key < searchKey ? x?forward[1]?key
x := x?forward[1]
if x?key = searchKey then return x?value
else return failure


merci

1 réponse

Arto_8000 Messages postés 1044 Date d'inscription lundi 7 mars 2005 Statut Membre Dernière intervention 13 juillet 2010 7
14 oct. 2009 à 16:21
0
Rejoignez-nous