Answers for "binary tree in c search"

C
0

binary tree in c search

node* search(node ** tree, int val) {
 if(!(*tree)) {
   return NULL;
  }
 if(val == (*tree)->data) {
   return *tree;
  } else if(val < (*tree)->data) {
    search(&((*tree)->left), val);
  } else if(val > (*tree)->data){
    search(&((*tree)->right), val);
  }
 }
Posted by: Guest on April-01-2022

Code answers related to "binary tree in c search"

Code answers related to "C"

Browse Popular Code Answers by Language