package leetcode;

/**
 * https://leetcode.com/problems/insert-into-a-binary-search-tree/
 */
public class Problem701 {
    public static class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;

        TreeNode(int x) {
            val = x;
        }
    }

    public TreeNode insertIntoBST(TreeNode root, int val) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem701 prob = new Problem701();
    }
}

package leetcode;

/**
 * https://leetcode.com/problems/insert-into-a-binary-search-tree/
 */
public class Problem701 {
    public static class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;

        TreeNode(int x) {
            val = x;
        }
    }

    public TreeNode insertIntoBST(TreeNode root, int val) {
        if (root == null) {
            return new TreeNode(val);
        }
        if (root.val > val) {
            root.left = insertIntoBST(root.left, val);
        } else {
            root.right = insertIntoBST(root.right, val);
        }
        return root;
    }
}

Solve problem 701 (my 600th problem :)
Solve problem 701 (my 600th problem :)
