MCQ Bank
Which of the following represents frequency of all characters in Huffman Encoding tree?
- A) Root Node
- B) Left Branch
- C) Leaf Node
- D) Right Branch
The ASCII value for character ‘A’ is:
- A) 66
- B) 68
- C) 65
- D) 67
In min heap, deletemin() will put the ______ element at the first position of the array.
- A) Third
- B) Last
- C) Second
- D) None of the given options.
Which of the following method take one element at a time to make a heap?
- A) traverse ()
- B) percolatedown ()
- C) Buildheap()
- D) Insert ()
A hole is created which needs to be filled if the element is __________ from the heap.
- A) Inserted
- B) Deleted
- C) Updated
- D) There is no concept of hole in heap
Consider a min heap, represented by the following array: 5,6,8,9,7 After deleting the root node. Which of the following is the updated min heap?
- A) 8,7,9,6
- B) 6,7,9,8
- C) 6,8,9,7
- D) 6,7,8,9
Consider a max heap, represented by the following array: 49, 39, 36, 31, 27, 21, 35, 12 After the deletion of node with value 49. Which of the following is the updated max heap?
- A) 39, 36, 35 ,21, 27, 31, 12
- B) 39, 36, 31 ,27, 21, 35, 12
- C) 39, 36, 31,12, 27, 21, 35
- D) 39, 31, 36,12, 27, 21, 35
Consider the max heap represented by the following array. Which of the following is the parent of node 14? 50,40,30,20,25,26,27,18,14
- A) 50
- B) 20
- C) 30
- D) 40
Which of the following node has the maximum value in a max heap?
- A) Right most child
- B) None of the given options.
- C) Left most child
- D) Root node
While implementing min heap, the for loop in insert() method is initialized with ___________.
- A) int hole = currentSize;
- B) int hole = ++currentSize;
- C) int hole = 2*currentSize;
- D) int hole = --currentSize;
Which of the following method takes an array to make a heap out of it?
- A) Buildheap()
- B) traverse ()
- C) percolatedown ()
- D) Insert ()
Which of the following formula gives the index position of the right child of “i” ?
- A) i/2
- B) 2+i
- C) 2*i
- D) 2i+1
Which of the following formula gives the index position of the left child of “i”?
- A) 2i+1
- B) 2*i
- C) 2+i
- D) i/2
A complete binary tree with a property that the value at each node is at least as small as the values in its children are called as _______.
- A) Binary tree
- B) Min Heap
- C) Max Heap
- D) Binary search tree
In min heap, deletemin() will put the ______ element at the first position of the array.
- A) None of the given options.
- B) Second
- C) Third
- D) Last
A hole is created which needs to be filled if the element is __________ from the heap.
- A) There is no concept of hole in heap
- B) Inserted
- C) Deleted
- D) Updated
A complete binary tree with a property that the value at each node is at least as small as the values in its children are called as _______.
- A) Binary search tree
- B) Max Heap
- C) Binary tree
- D) Min Heap
Which of the following formula gives the index position of the left child of “i”?
- A) 2*i
- B) i/2
- C) 2i+1
- D) 2+i
Consider the max heap represented by the following array. Which of the following is the parent of node 14? 50,40,30,20,25,26,27,18,14
- A) 50
- B) 30
- C) 40
- D) 20
Which of the following formula gives the index position of the right child of “i” ?
- A) 2+i
- B) 2*i
- C) 2i+1
- D) i/2