Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. node_t *insert_node(node_t *root, node_t *new)
  2. {
  3.     node_t** curr = &root;
  4.     while (*curr)
  5.     {
  6.         if (strcmp(new->name, (*curr)->name) < 0)
  7.             curr = &(*curr)->left;
  8.         else curr = &(*curr)->right;
  9.     }
  10.    
  11.     *curr = new;
  12.     return root;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement