Revision as of 18:00, 27 April 2012 by Wang820 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Shiyu Wang Lec28 April 27th

typedef struct treenode {

 struct treenode *left;
 struct treenode *right;
 int value;

}Node;

Node* root=NULL;

root=tree_insert(root,13);

root=tree_insert(root,7);

root=tree_insert(root,22);

Node*Tree_insert(Node*n,int v) {

 if(n==NULL)
 {
   return Node_construct(v);
 }
 if((n->value)==v)
 {
   return n;
 }
 if((n->value)>v)
 {
   n->left=Tree_insert(n->left,v);
 }
 else
 {
   n->right=Tree_insert(n->right,v);
 }
 return n;

}

Alumni Liaison

Ph.D. 2007, working on developing cool imaging technologies for digital cameras, camera phones, and video surveillance cameras.

Buyue Zhang