Advertisement
daniele2013

delete abr k1< k < k2

Nov 11th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Del_Int(T,k1,k2)
  2. IF T ≠ NIL THEN
  3. IF T->Key > k1 THEN T->SX = Del_Int(T->SX,k1,k2)
  4. IF T->Key < k2 THEN T->DX = Del_Int(T->DX,k1,k2)
  5. IF T->Key >= k1 && T->Key <= k2 THEN
  6. IF T->SX = NIL THEN
  7. nodo = T
  8. T = T->DX
  9. ELSE IF T->DX = NIL THEN
  10. nodo = T
  11. T = T->SX
  12. ELSE
  13. nodo = Stacca_Minimo(T->DX,T)
  14. *copia nodo in T*
  15. Dealloca(nodo)
  16. return T
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement