Question 11
In a binary tree, which traversal visits the root before both subtrees?
Preorder traversal follows Root, Left, Right.
In a binary tree, which traversal visits the root before both subtrees?
Preorder traversal follows Root, Left, Right.
For a binary tree with n nodes, what is the time complexity of a complete traversal?
Every node is visited once.
Which traversal of a BST can be used to output keys in nondecreasing order?
BST inorder traversal visits left subtree, root, then right subtree.
A binary tree has height h. What is the minimum possible number of nodes when h is measured in edges?
A skewed tree can have exactly one node at each level.
A perfect binary tree has 31 nodes. What is its height when the root has height 0?
$A perfect tree of height h has 2^{h+1}-1 nodes; 31=2^5-1.$