GkSeries.com

Trees MCQs | Trees Multiple Choice Questions and Answers

(1) In ……………………….. ; for any node n, every descendant node’s value in the left subtree of n is less than the value of n and every descendant node’s value in the right subtree is greater than the value n.
[A] binary tree
[B] binary search tree
[C] AVL tree
[D] binary heap tree
Answer: binary search tree
(2) For finding a node in a …………………, at each stage we ideally reduce the number of nodes we have to check by half.
[A] binary tree
[B] binary search tree
[C] AVL tree
[D] binary heap tree
Answer: binary tree

DOWNLOAD CURRENT AFFAIRS PDF FROM APP

(3) …………………. of binary search tree starts by visiting the current node, then its left child and then its right child.
[A] Preorder traversal
[B] In-order traversal
[C] Linear traversal
[D] Post-order traversal
Answer: Linear traversal
(4) With an ideal balance, the running time for inserts, searches and deletes, even in the worst case is ………………………
[A] log₂n
[B] n
[C] log₂(n+1)
[D] n+1
Answer: log₂n
(5) In binary search tree, a …………………. exists if starting from some node n there exists a path that returns to n.
[A] Cycle
[B] Node
[C] Root
[D] Subtree
Answer: Cycle
(6) ………………… is a binary search tree whose leaves are external nodes.
[A] Red-Black Tree
[B] AVL Tree
[C] Binary Heap Tree
[D] A-A Tree
Answer: Red-Black Tree
(7) ………………… is a complete binary tree, that is completely filled except possibly at the bottom level.
[A] Red-Black Tree
[B] AVL Tree
[C] Binary Heap Tree
[D] A-A Tree
Answer: Binary Heap Tree
(8) While deleting nodes from a binary heap, …………………. node is replaced by the last leaf in the tree.
[A] Left Leaf
[B] Right Leaf
[C] Root
[D] Cycle
Answer: Root
(9) The height of a BST is given as h. Consider the height of the tree as the no. of edges in the longest path from root to the leaf. The maximum no. of nodes possible in the tree is?
[A] 2h-1 -1
[B] 2h+1 -1
[C] 2h +1
[D] 2h-1 +1
Answer: 2h+1 -1
(10) The difference between the external path length and the internal path length of a binary tree with n internal nodes is?
[A] 1
[B] n
[C] n + 1
[D] 2n
Answer: 2n
(11) Which of the following statement about binary tree is CORRECT?
[A] Every binary tree is either complete or full
[B] Every complete binary tree is also a full binary tree
[C] Every full binary tree is also a complete binary tree
[D] A binary tree cannot be both complete and full
Answer: Every full binary tree is also a complete binary tree
(12) Suppose we have numbers between 1 and 1000 in a binary search tree and want to search for the number 363. Which of the following sequence could not be the sequence of the node examined?
[A] 2, 252, 401, 398, 330, 344, 397, 363
[B] 924, 220, 911, 244, 898, 258, 362, 363
[C] 925, 202, 911, 240, 912, 245, 258, 363
[D] 2, 399, 387, 219, 266, 382, 381, 278, 363
Answer: 925, 202, 911, 240, 912, 245, 258, 363
(13) Which type of traversal of binary search tree outputs the value in sorted order?
[A] Pre-order
[B] In-order
[C] Post-order
[D] None
Answer: In-order
(14) Suppose a complete binary tree has height h>0. The minimum no of leaf nodes possible in term of h is?
[A] 2h -1
[B] 2h -1 + 1
[C] 2h -1
[D] 2h +1
Answer: 2h -1
(15) A 2-3 is a tree such that a) All internal nodes have either 2 or 3 children b) All path from root to leaves have the same length The number of internal nodes of a 2-3 tree having 9 leaves could be
[A] 4
[B] 5
[C] 7
[D] Both a and c
Answer: Both a and c
(16) If a node having two children is to be deleted from binary search tree, it is replaced by its
[A] In-order predecessor
[B] In-order successor
[C] Pre-order predecessor
[D] None
Answer: In-order successor
(17) A binary search tree is formed from the sequence 6, 9, 1, 2, 7, 14, 12, 3, 8, 18. The minimum number of nodes required to be added in to this tree to form an extended binary tree is?
[A] 3
[B] 6
[C] 8
[D] 11
Answer: 11
(18) the run time for traversing all the nodes of a binary search tree with n nodes and printing them in an order is
[A] O(nlg(n))
[B] O(n)
[C] O(√n)
[D] O(log(n))
Answer: O(n)
(19) When a binary tree is converted in to an extended binary tree, all the nodes of a binary tree in the external node becomes
[A] Internal nodes
[B] External nodes
[C] Root nodes
[D] None
Answer: Internal nodes
(20) If n elements are sorted in a balanced binary search tree. What would be the asymptotic complexity to search a key in the tree?
[A] O(1)
[B] O(logn)
[C] O(n)
[D] O(nlogn)
Answer: O(logn)

Please share this page

Click Here to Read more questions

Teacher Eligibility Test