Advertisement
Meruem

Inserimento da albero binario in vettore senza multipli

Jun 25th, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function insert(t,v)
  2. {
  3.     var cur,i,c1=0;
  4.     if(t.root==null){return v;}
  5.     cur=t.root; for(i=0;i<v.lenght;i++)
  6.     {
  7.         if(cur.x!=v[i]){c1++;}
  8.         if(c1==v.lenght){v.push(cur);}
  9.     } insert(t.left,v);
  10.     insert(t.right,v);
  11.     return v;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement