CommerceBinary Search TreesB Tree MCQs
Practice Binary Search TreesB Tree MCQs for competitive exams.
Binary Search TreesB Tree MCQs
Practice questions from this topic.
What does the below definations convey? i. A binary tree is balanced if for every node it is gonna hold that the number of inner nodes in the left subtree and the number of inner nodes in the right subtree differ by at most 1. ii. A binary tree is balanced if for any two leaves the difference of the depth is at most 1.
- A. weight balanced and height balanced tree definations
- B. height balanced and weight balanced tree definations
- C. definations of weight balanced tree
- D. definations of height balanced tree
Correct Answer: A
Which operation is used to break a preferred path into two sets of parts at a particular node?
- A. Differentiate
- B. Cut
- C. Integrate
- D. Join
Correct Answer: B
In which of the following self - balancing binary search tree the recently accessed element can be accessed quickly?
- A. AVL tree
- B. AA tree
- C. Splay tree
- D. Red - Black tree
Correct Answer: C
Consider the below left-left rotation pseudo code where the node contains value pointers to left, right child nodes and a height value and Height() function returns height value stored at a particular node. avltree leftrotation(avltreenode z): avltreenode w =x-left x-left=w-right w-right=x x-height=max(Height(x-left),Height(x-right))+1 w-height=max(missing)+1 return w What is missing?
- A. Height(w-left), x-height
- B. Height(w-right), x-height
- C. Height(w-left), x
- D. Height(w-left)
Correct Answer: A
What is the speciality of cartesian sorting?
- A. it sorts partially sorted set of data quickly
- B. it considers cartesian product of elements
- C. it sorts elements in less than O(logn)
- D. it is a self balancing tree
Correct Answer: A
How many top trees are there in a tree with single vertex?
- A. 0
- B. 1
- C. 2
- D. 3
Correct Answer: A
The post-order traversal of a binary tree is O P Q R S T. Then possible pre-order traversal will be . . . . . . . .
- A. T Q R S O P
- B. T O Q R P S
- C. T Q O P S R
- D. T Q O S P R
Correct Answer: C
If binary trees are represented in arrays, what formula can be used to locate a left child, if the node has an index i?
- A. 2i+1
- B. 2i+2
- C. 2i
- D. 4i
Correct Answer: A
How many edges does a leaf cluster contain?
- A. 0
- B. 1
- C. 2
- D. 3
Correct Answer: A
What is the time complexity for the initialization of top tree?
- A. O (n)
- B. O (n 2 )
- C. O (log n)
- D. O (n!)
Correct Answer: A
Consider a weight balanced tree such that, the number of nodes in the left sub tree is at least half and at most twice the number of nodes in the right sub tree. The maximum possible height (number of nodes on the path from the root to the farthest leaf) of such a tree on k nodes can be described as
- A. log2 n
- B. log4/3 n
- C. log3 n
- D. log3/2 n
Correct Answer: D
What is the range of β in finding the length of the longest path in a randomized binary search tree?
- A. (-1, 0)
- B. (1, 0)
- C. (0, 5)
- D. (0, 1)
Correct Answer: D