CS174: Module 16: Binary Trees: Level And Depth

Developed by Professor Tralie and Professor Mongan.


Please watch the video below, and click the next button once you have finished

Notes

  • The level of a node in a binary tree is the minimum length path from the root to that node.
  • The depth of a tree is the maximum level over all nodes.
  • We often implement recursive functions on trees by having two overloaded versions of a method: one to kick off the recursion on the root node, and one to continue the recursion on internal nodes.