For this task, you will implement a simple binary search on an existing binary tree. A binary tree has the following structure:
This binary tree is composed of nodes implemented using the following structure.
/*
* Node has a value, @value, and two children, @left and @right.
* All the children of @left and itself have a smaller value than the node and all the children of @right and itself have a larger value than node
*/
typedef struct node{
int value;
struct node* left; // to smaller values
struct node* right; // to larger values
} node_t;
The binary tree itself is defined as follows.
typedef struct bt{
struct node* root;
} bt_t;
INGInious