SHARE
TWEET

Untitled

a guest Sep 20th, 2017 138 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. procedure del_left(in/out:root,parent,node)
  2. begin
  3.      var albero: root,parent,nodo,new_parent,new_node
  4.      new_parent:=parent
  5.      new_node:=nodo.left
  6.      if(parent!=NULL)then
  7.         parent.left:=nodo.left
  8.      else
  9.         root:=nodo.left
  10.      endif
  11.      while(new_node!=NULL)do
  12.            new_parent:=new_node
  13.            new_node:=new_node.right
  14.      endwhile
  15.      if(nodo.left!=NULL)then
  16.         if(new_parent!=NULL)then
  17.            new_parent.right:=nodo.right
  18.         else
  19.            root:=nodo.right
  20.         endif
  21.      else
  22.          if(parent!=NULL)then
  23.             parent.right:=nodo.right
  24.          else
  25.             root:=nodo.right
  26.          endif
  27.      endif
  28. end del_left
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top