Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sentinella (T,K1,K2,X)
- // VISITA, controlla se nodo è compreso, se compreso decrementa la x da passare ai figli
- if k1< key <k2 then
- x--
- // Restituisce FALSE se il numero di nodi è maggiore di x, TRUE se sono arrivato ad una foglia e i nodi compresi sono <x
- if nodo==NIL AND x>0
- return True
- else if x=0
- return False
- else
- return Sentinella(T->SX,k1,k2,x) AND Sentinella(T->DX,k1,k2,x) // La x è stata decrementata sopra
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement