Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Algo(T,k1,k2)
- P = NIL
- Z = T
- Y,X;
- while (z!= NIL) do
- P=Z
- If Z->key < k1 then
- Z=Z->dx
- If Z->key > k2 then
- Z=Z->sx
- else
- If (Z->sx == NIL OR Z->dx == NIL) Then
- Y=Z
- else
- Y=Z->dx; P=Z
- while(Y->sx != NIL) DO
- P=Y
- Y=Y->sx
- If (Y->sx != NIL) then
- X=Y->sx
- else
- X=Y->dx
- If (P=NIL) then
- T=X
- else if (Y=P->SX) then
- P->sx = X
- else
- P->dx = X
- If (Y!=Z) Then
- "copia i campi di y in z"
- "dealloca Y"
- return T
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement