Answers for the "Sample Final Exam Multiple Choice Questions"


=======================================
What is the maximum height of an AVL tree with n nodes?
Answer: O(log n)

=======================================
The Data structure used in a standard implementation of Breadth 
First Search (as discussed in the lectures) is?
Answer: Queue

=======================================

 

=======================================

 

=======================================
Which one of the following array elements, sequences stating at index 1, 
represents a binary min heap?
Answer: 8 10 12 25 14 17

=======================================
For the tree below, select the choice that provides post-order traversal.
Answer: None of the other four choices are correct.

=======================================
What is the time complexity of the following algorithm? Assume that creating a 
stack and pushing an element both are O(1) operations, and initially n > 0.

  create empty stack S
  while n>0 do
  |  push (n mod 2) onto S
  |  n=n/2
  end while  

Answer: O(log n)

=======================================