CommerceBinary Search TreesB Tree MCQs
Practice Binary Search TreesB Tree MCQs for competitive exams.
Binary Search TreesB Tree MCQs
Practice questions from this topic.
How will you remove a left horizontal link in an AA-tree?
- A. by performing right rotation
- B. by performing left rotation
- C. by deleting both the elements
- D. by inserting a new element
Correct Answer: A
What is the time complexity of pre-order traversal in the iterative fashion?
- A. O(1)
- B. O(n)
- C. O(logn)
- D. O(nlogn)
Correct Answer: B
What is the upper bound for a tango tree if k is a number of interleaves?
- A. k+2 O (log (log n))
- B. k O (log n)
- C. K 2 O (log n)
- D. k+1 O (log (log n))
Correct Answer: D
Which of the following tree data structures is not a balanced binary tree?
- A. AVL tree
- B. Red-black tree
- C. Splay tree
- D. B-tree
Correct Answer: D
What is the time complexity for splitting the string into two new string in the rope data structure?
- A. O (n 2 )
- B. O (n!)
- C. O (log n)
- D. O (1)
Correct Answer: C
How many edges are present in Edge cluster?
- A. 0
- B. 1
- C. 2
- D. 4
Correct Answer: B
In an AA-tree, we process split first, followed by a skew.
- A. True
- B. False
Correct Answer: B
What is the time complexity for inserting the string and forming a new string in the rope data structure?
- A. O (log n)
- B. O (n!)
- C. O (n 2 )
- D. O (1)
Correct Answer: A
Elements in a tree can be indexed by its position under the ordering of the keys and the ordinal position of an element can be determined, both with good efficiency.
- A. true
- B. false
Correct Answer: A
How will you find the minimum element in a binary search tree?
- A. public void min(Tree root) { while(root.left() != null) { root = root.left(); } System.out.println(root.data()); }
- B. public void min(Tree root) { while(root != null) { root = root.left(); } System.out.println(root.data()); }
- C. public void min(Tree root) { while(root.right() != null) { root = root.right(); } System.out.println(root.data()); }
- D. public void min(Tree root) { while(root != null) { root = root.right(); } System.out.println(root.data()); }
Correct Answer: A
Which of the following are used as an internal operation in Top tree?
- A. Merge
- B. Cut
- C. Expose
- D. Link
Correct Answer: A
What is the expected depth of a node in a randomized binary search tree?
- A. log n
- B. n!
- C. n 2
- D. 2 log n + O(1)
Correct Answer: D