@@ -0,0 +1,826 @@
+package com.sunny.grokkingalgorithms.fasttrack.week2;%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/24/2018.%0A */%0Apublic class HeightOfATree %7B%0A%0A  /*%0A  Find height of a tree.%0A   */%0A%0A  /**%0A   *%0A   * @param root%0A   * @return%0A   */%0A  public static int height(BinaryTreeNode root)%7B%0A    if(root == null)%7B%0A      return 0;%0A    %7D%0A    int leftHeight = height(root.left);%0A    int rightHeight = height(root.right);%0A    return Math.max(leftHeight,rightHeight) + 1;%0A  %7D%0A%0A  /**%0A   *%0A   * @param args%0A   */%0A  public static void main(String%5B%5D args) %7B%0A    BinaryTreeNode root = TreeUtils.createBST();%0A    TreeUtils.performBfsLevelMarker(root);%0A    System.out.println(%22Height of tree = %22);%0A    System.out.println(height(root));%0A  %7D%0A%0A%7D%0A

Find height of a tree.