henrylin03 / odin-binary-search-tree

Implementing balanced binary search tree (BST) from a sorted array in JavaScript, as part of The Odin Project's "Full Stack JavaScript" course
MIT License
0 stars 0 forks source link

write `depth(node)` function #13

Closed henrylin03 closed 3 months ago

henrylin03 commented 3 months ago

Write a depth(node) function that returns the given node’s depth. Depth is defined as the number of edges in the path from a given node to the tree’s root node.

Image source: stackoverflow