Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsHeightBalanced ¶
func IsHeightBalanced(root *BinaryTree) bool
IsHeightBalanced returns true if the tree is height balanced. It returns false otherwise. Runs in O(N) time.
Types ¶
type BinaryTree ¶
type BinaryTree struct {
// Value int // is unnecessary. We don't need any value.
Left, Right *BinaryTree
}
BinaryTree is a simple binary tree without a value.
Click to show internal directories.
Click to hide internal directories.