Trees and Transversals Flashcards
What is in order transversal
Left → Root → Right
What is Preorder transversal
Root → Left → Right
What is Postorder transversal
Left → Right → Root
Why are AVL trees used
They are self-balancing BSTs, maintaining O(log n) operations
What’s the height of a complete binary tree with 15 nodes?
3 (0-based), since 15 = 2⁴ - 1
What property defines a min-heap?
Every parent is less than or equal to its children.
What’s the minimum number of nodes in an AVL tree of height h
F(h+2) − 1, where F is the Fibonacci sequence
In an AVL tree, what balance factor range is valid
Must be -1, 0, or +1
What is the balance factor of a leaf node in an AVL tree
0 — both left and right heights are -1
What’s the result of deleting the root in a BST and replacing it with a value from the right subtree?
The smallest value from the right subtree replaces the root
Can a min-heap also be a binary search tree?
No — BSTs must satisfy in-order value rules, heaps only structural.