Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.44 KB | None | 0 0
  1. Sentinella (T,K1,K2,X)
  2. // VISITA, controlla se nodo è compreso, se compreso decrementa la x da passare ai figli
  3.     if k1< key <k2 then
  4.         x--
  5. // Restituisce FALSE se il numero di nodi è maggiore di x, TRUE se sono arrivato ad una foglia e i nodi compresi sono <x
  6.     if nodo==NIL AND x>0
  7.             return True
  8.     else if x=0
  9.         return False
  10.     else
  11.         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