Skip to content
This repository has been archived by the owner on Sep 11, 2019. It is now read-only.

Latest commit

 

History

History
17 lines (11 loc) · 671 Bytes

README.md

File metadata and controls

17 lines (11 loc) · 671 Bytes
This is a HackerRank challenge:

https://www.hackerrank.com/challenges/tree-height-of-a-binary-tree/problem

Binary Tree Height

The height of a binary tree is the number of edges between the tree's root and its furthest leaf. The Height of binary tree with single node is taken as zero.

Input Format:

The first line contains an integer n, the number of nodes in the tree.

Next line contains n space separated integer where i integer denotes node[i].data.

Binary Search Tree Reference

In a binary search tree, all nodes on the left branch of a node are less than the node value. All values on the right branch are greater than the node value.