92: Insert in a binary search tree

Given a binary search tree and an integer, insert this value into the binary search tree and return the root node

 

Example 1

Input:        3   value = 1
             / \  
            2   8 

Output:       3
             / \ 
            2   8
           /
          1

Example 2

Input:        3   value = 5
             / 
            2   

Output:       3
             / \
            2   5
Difficulty:Easy
Topic:Tree
Problem #:92