### height

#### Java Binary Tree Height

How would I go about solving this question? I'm pretty sure that the height of this tree is 3... Please correct me if I'm wrong! Thanks!

What the question asks is, How many combinations are there to insert elements to the binary tree in order to obtain the maximum height of the binary tree Suppose if we insert elements to the tree in the reverse sorted manner. First 5, then 4 and finally 1. In this case, each element will be added to the right of the parent making a tree of height 5. Suppose if we insert elements in sorted order. Then each element will be added to the left of it's parent which also make the tree of height 5. In both of the above cases, child nodes were added only to left side or right side of a parent In all the other combinations, since there can be at least one element with two children, the height of the tree will not exceed 4. Therefore, the answer for the question is 2 since there is only two combinations to achieve the maximum height, 5. The height of the tree will be 3 only when the tree is balanced. Hope you found the solution.

### Related Links

Binary Tree find height of a specific Node

Re-size the Text and Button/Label in Livecode

Overlay a background image onto the web page

WooCommerce - change price based on product_id, width and height

Susy gallery breaks height for display table and table-cell

Flex Slider full height and width without stretching

mPDF set Height for SetHTMLHeader

How to Set Height of PdfPTable in iTextSharp

Margin not showing with 100% width & height

KO Grid Scrollbars not visible & Display issues

Increase scrollview's element height on clicking it

Using soft keyboard on libgdx for iOS and Android (hides textview)

Fine-uploader - Scaling picture by height

Zurb foundation framework - 100% height grid

Dynamically expanding CollectionView : Height of the CollectionView itself (not the items) changing when adding new items

IE 11 bug, div with height > 1,533,917px display negative computed height and doesnt render