@@ -0,0 +1,1098 @@
+package com.sunny.grokkingalgorithms.fasttrack.treesandgraphs;%0A%0Aimport com.sunny.grokkingalgorithms.ctci.c4.util.BinaryTreeNode;%0Aimport com.sunny.grokkingalgorithms.ctci.c4.util.TreeUtils;%0A%0A/**%0A * Created by sundas on 6/9/2018.%0A */%0Apublic class CreateBSTFromSortedArray %7B%0A%0A  /*%0A  Given a sorted array create a BST with minimum height%0A   */%0A%0A  /**%0A   *%0A   * @param input%0A   * @return%0A   */%0A  public static BinaryTreeNode createBSTWithMinimumHeight(int%5B%5D input,%0A                                                          int start,int end)%7B%0A    if(start %3E end)%7B%0A      return null;%0A    %7D%0A    BinaryTreeNode root = new BinaryTreeNode();%0A    int mid = start + (end - start)/2;%0A    root.data = input%5Bmid%5D;%0A    root.left = createBSTWithMinimumHeight(input,start,mid - 1);%0A    root.right = createBSTWithMinimumHeight(input,mid+1,end);%0A    return root;%0A  %7D%0A%0A%0A  /**%0A   *%0A   * @param args%0A   */%0A  public static void main(String%5B%5D args) %7B%0A    int%5B%5D input = new int%5B%5D%7B1,2,3,4,5,6%7D;%0A    BinaryTreeNode root = createBSTWithMinimumHeight(input,0,input.length - 1);%0A    TreeUtils.performBfsLevelMarker(root);%0A  %7D%0A%0A%7D%0A

Create BST with minimal height from sorted inoput array.