diff --git a/Binary_Tree/searchBinaryTree b/Binary_Tree/searchBinaryTree new file mode 100644 index 0000000..550bd3e --- /dev/null +++ b/Binary_Tree/searchBinaryTree @@ -0,0 +1,12 @@ +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); + } + }