Check out example codes for "binary tree in data structure". It will help you in understanding the concepts better.

Code Example 1

In computer science, a binary tree is a tree data structure in which 
each node has at most two children, which are referred to as the left 
child and the right child.

Code Example 2

void insert(int data) {
   struct node *tempNode = (struct node*) malloc(sizeof(struct node));
   struct node *current;
   struct node *parent;

   tempNode->data = data;
   tempNode->leftChild = NULL;
   tempNode->rightChild = NULL;

   //if tree is empty, create root node
   if(root == NULL) {
      root = tempNode;
   } else {
      current = root;
      parent  = NULL;

      while(1) {                
         parent = current;

         //go to left of the tree
         if(data < parent->data) {
            current = current->leftChild;                
            //insert to the left
            if(current == NULL) {
               parent->leftChild = tempNode;
         //go to right of the tree
         else {
            current = current->rightChild;
            //insert to the right
            if(current == NULL) {
               parent->rightChild = tempNode;

Learn ReactJs, React Native from