@@ -0,0 +1,1346 @@
+package data_structures.trees;%0D%0A%0D%0A/*%0D%0A * You are given a pointer to the root of a binary search tree and a value to be%0D%0A * inserted into the tree. Insert this value into its appropriate position in%0D%0A * the binary search tree and return the root of the updated binary tree. You%0D%0A * just have to complete the function.%0D%0A * %0D%0A * Input Format: %0D%0A * You are given a function,%0D%0A * %0D%0A * node * insert (node * root ,int value) %7B%0D%0A * %0D%0A * %7D%0D%0A * node is defined as :%0D%0A * %0D%0A * struct node %7B%0D%0A * int data;%0D%0A * node * left;%0D%0A * node * right;%0D%0A * %7Dnode;%0D%0A * %0D%0A * Output Format: %0D%0A * Return the root of the binary search tree after inserting the value into the%0D%0A * tree.%0D%0A * %0D%0A * Sample Input: %0D%0A *      4%0D%0A *    /   %5C%0D%0A *   2     7%0D%0A *  / %5C%0D%0A * 1   3%0D%0A * The value to be inserted is 6.%0D%0A * %0D%0A * Sample Output: %0D%0A *      4%0D%0A *    /   %5C%0D%0A *   2     7%0D%0A *  / %5C   /%0D%0A * 1   3 6%0D%0A */%0D%0Apublic class BinarySearchTreeInsertion %7B%0D%0A%0D%0A%09static Node Insert(Node root,int value) %7B%0D%0A%0D%0A%09    if (root == null) %7B%0D%0A%09        Node newNode = new Node();%0D%0A%09        newNode.data = value;%0D%0A%09        newNode.left = null;%0D%0A%09        newNode.right = null;%0D%0A%09        root = newNode;%0D%0A%09    %7D else if (root.data %3E value) %7B%0D%0A%09        root.left = Insert(root.left, value);%0D%0A%09    %7D else if (root.data %3C value) %7B%0D%0A%09        root.right = Insert(root.right, value);%0D%0A%09    %7D%0D%0A%09    return root;%0D%0A%09%7D%0D%0A%7D

Add BinarySearchTreeInsertion