MCQ Bank
In an expression tree, if symbol is an operand add it on a ___________.
- A) Linked list
- B) Stack
- C) Queue
- D) Heap
To evaluate an expression tree which of following techniques is used?
- A) Left to right
- B) Top down
- C) Bottom up
- D) Right to left
Consider a complete binary tree, represented by the following array (array index starts at 1):
19, 7, 15, 6, 4, 13, 2, 3, 2
What will be values of the children of the node with value ‘15’?
Left:________ Right:__________
- A) 4,13
- B) 13,2
- C) 6,4
- D) 19,7
In an expression tree, a unary operator will have only ________ subtree.
- A) None
- B) Three
- C) Two
- D) One
The worst case of building a heap of N keys is _______ .
- A) NlogN
- B) 2^N
- C) N^2
- D) N
Which of the following statement is not correct about Binary Trees, where binary tree traversals are carried out repeatedly?
- A) It is useful to modify the tree data structure which represents the binary tree to speed up the inorder traversal process by making it stack free.
- B) The overhead of stack operations during recursive calls can be costly.
- C) It is very cumbersome to modify the tree data structure as most of pointer fields are not NULL.
- D) If we use non-recursive but stack driven traversal procedure then it would be costly again.
In which of the following tree, parent node has key greater than or equal to its both children?
- A) Max heap
- B) Binary search tree
- C) Threaded Binary tree
- D) Complete Binary tree
If whole data is given to construct the min heap, then which of the following is true?
- A) BuildHeap method is appropriate for construction
- B) Both Insert and Buildheap methods are inappropriate.
- C) Insert method is appropriate for construction
- D) Both Insert and BuildHeap method are equally appropriate
If both pointers of the node in a binary tree are NULL then it will be a/an
- A) None of the given options
- B) Inner node
- C) Leaf node
- D) Root node
In Huffman encoding, codes are sent to the receiver in ___________ format.
- A) Binary
- B) Hexadecimal
- C) Octal
- D) ASCII
If there are 23 external nodes in a binary tree then what will be the no. of internal nodes in this binary tree?
- A) 24
- B) 23
- C) 22
- D) 21
In Huffman tree, the process of combining the two nodes of lowest frequency will be carried out until ________ node/nodes left.
- A) One
- B) Zero
- C) More than two nodes
- D) Two
Consider a min heap, represented by the following array:
3,4,6,7,5
After calling the function deleteMin().Which of the following is the updated min heap?
- A) 4,5,6,7
- B) 4,6,5,7,
- C) 4,6,7,5
- D) 6,7,5,4
In a threaded binary tree which nodes have NULL child pointers,
- A) All leaf nodes
- B) Nodes other then leaf nodes
- C) None of the nodes
- D) Root Node
In complete binary tree the bottom level is filled from ________
- A) Left to right
- B) Not filled at all
- C) Right to left
- D) None of the given options
In deletion, ________ method reorganizes the min heap.
- A) DecreaseKey
- B) IncreaseKey
- C) PercolateDown
- D) Percolate_Below
See the below code and fill the appropriate answer for ? sign.
void fastInorder(TreeNode* p)
{
while((p=nexInorder(p)) != ? )
cout << p->getInfo();
}
- A) LTH
- B) rootNode
- C) dummy
- D) RTH
Consider a min heap, represented by the following array:
3,4,6,7,5,10
After inserting a node with value 1. Which of the following is the updated min heap?
- A) 3,4,6,7,5,10,1
- B) 1,4,6,7,5,10,3
- C) 3,4,6,7,5,1,10
- D) 1,4,3,7,5,10,6
We implement the heap by ______________ .
- A) Threaded Tree
- B) Expression tree
- C) AVL tree
- D) Complete binary tree
Consider a min heap, represented by the following array:
10,30,20,60,40,50,80,70
After inserting a node with value 31.Which of the following is the updated min heap?
- A) 10,30,20,31,40,50,80,60,70
- B) 10,30,20,31,40,50,80,70,60
- C) 10,30,20,70,40,50,80,60,31
- D) 31,10,30,20,70,40,50,80,60