MCPcopy
hub / github.com/yangshun/lago / height

Method height

src/data-structures/BinaryTree.ts:31–37  ·  view source on GitHub ↗

* Get the height of the tree. * @return {number} The height of the tree.

()

Source from the content-addressed store, hash-verified

29 * @return {number} The height of the tree.
30 */
31 height(): number {
32 if (!this.root) {
33 return 0;
34 }
35
36 return this.root.height();
37 }
38
39 /**
40 * Traverse the tree in an in-order fashion.

Callers 6

AVLTree.test.tsFile · 0.45
assertAvlFunction · 0.45
BinaryTree.test.tsFile · 0.45
calcBalanceMethod · 0.45
isBalancedImplMethod · 0.45

Calls

no outgoing calls

Tested by 1

assertAvlFunction · 0.36