MCQ Bank
To evaluate an expression tree which of following techniques is used?
- A) Right to left
- B) Left to right
- C) Bottom up
- D) Top down
Consider a min heap, represented by the following array:
11,22,33,44,55
After inserting a node with value 66.Which of the following is the updated min heap?
- A) 11,22,33,66,44,55
- B) 11,22,66,33,44,55
- C) 11,22,33,44,55,66
- D) 11,22,33,44,66,55
In which of the following tree, parent node has key greater than or equal to its both children?
- A) Binary search tree
- B) Threaded Binary tree
- C) Max heap
- D) Complete Binary tree
Which of the following method is helpful in creating the heap at once?
- A) insert
- B) percolateDown
- C) update
- D) add
In an expression tree, if symbol is an operand add it on a ___________.
- A) Queue
- B) Linked list
- C) Stack
- D) Heap
In a threaded binary tree which nodes have NULL child pointers,
- A) None of the nodes
- B) Nodes other then leaf nodes
- C) All leaf nodes
- D) Root Node
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) 19,7
- B) 4,13
- C) 13,2
- D) 6,4
If there are 23 external nodes in a binary tree then what will be the no. of internal nodes in this binary tree?
- A) 21
- B) 24
- C) 22
- D) 23
Consider a binary tree, represented by the following array:
10,7,9,5,2,1,6,3,4
This is a ________.
- A) Min heap
- B) Max heap
- C) Threaded binary tree
- D) Binary Search tree
A binary tree with N internal nodes has _____ links, _______ links to internal nodes and ________ links to external nodes.
- A) N+1, 2N, N-1
- B) 2N, N-1, N+1
- C) N-1, 2N, N+1
- D) N+1, N-1, 2N
To develop a character encoding scheme in Huffman tree, _______ will be assigned to left branch.
- A) -1
- B) 1 and 0
- C) 0
- D) 1
Consider a min heap, represented by the following array: 5, 6, 8, 9, 7, 12 What will be the status of array after inserting a new node with value 3?
- A) 3, 5, 6, 8, 9, 7, 12
- B) 3, 6, 5, 7, 9, 12, 8
- C) 3, 6, 8, 9, 7, 5, 12
- D) 3, 6, 5, 9, 7, 12, 8
Which of the following statement concerning heaps is NOT true?
- A) A heap can be used to implement a priority queue.
- B) A heap can be stored in an array.
- C) A heap can be used to sort data.
- D) A heap can be stored in a binary search tree.
The worst case of building a heap of N keys is _______ .
- A) N
- B) 2^N
- C) NlogN
- D) N^2
There are 100 elements in a heap, if we perform 100 deleteMin operations then we will get ___________ list
- A) Nonlinear
- B) Random
- C) Sorted
- D) Unsorted
If the height of a perfect binary tree is 4. What will be the total number of nodes in it?
- A) 32
- B) 15
- C) 31
- D) 16
In heap data structure, the time required for buildHeap() method will be proportional to ___________.
- A) Nlog2N
- B) N
- C) log2n
- D) N2
Median is __________.
- A) K = N * 3
- B) K = N / 2
- C) K = N * 2
- D) K = N / 3
Which of the following is NOT true regarding the maze generation?
- A) Removing a wall is the same as doing a union operation.
- B) Remove a randomly chosen wall if the cells it separates are already in the same set.
- C) Do not remove a randomly chosen wall if the cells it separates are already in the same set.
- D) Randomly remove walls until the entrance and exit cells are in the same set.
What is the time complexity of binary search with iteration?
- A) O(n)
- B) O(n2)
- C) O(nlogn)
- D) O(logn)