Skip to main content

Height / Depth

Learn Height / Depth (Trees, Data Structures & Algorithms) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Height vs Depth - Commonly Confused Terms Depth of a node - the number of edges from the ROOT down to that node. The root has depth 0. Height of a node - the number of edges on the LONGEST path from that node DOWN to a leaf. A leaf has height 0. Height of the tree - the height of the root, i.e. the longest root-to-leaf path.

More lessons in Trees