SHARE
TWEET

Untitled

a guest Sep 20th, 2017 142 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. procedure insert(in/out:root;in elem)
  2. begin
  3.       var albero: root,new_node
  4.       var integer: elem
  5.       if(empty(root))then
  6.          new_node.info:=elem
  7.          new_node.left:=NULL
  8.          new_node.right:=NULL
  9.          root=new_node
  10.       else
  11.          if(elem<root.info)then
  12.             insert(root.left,elem)
  13.          else
  14.             if(elem>root.right)then
  15.                insert(root.right,elem)
  16.             else
  17.                print("Elemento giĆ  inserito")
  18.             endif
  19.           endif
  20.         endif
  21. end insert
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