MCQ Bank
The expression
if ( ! heap->isEmpty() )
checks
- A) Heap is empty
- B) Heap is full
- C) Heap is not empty
- D) Not a valid expression
The main reason of using heap in priority queue is
- A) heap can't be used in priority queues
- B) less code
- C) improve performance
- D) code is readable
Which of the following is NOT an implementation of Table ADT?
- A) Linked List
- B) Sorted Sequential Array
- C) Stack
- D) Skip List
In perfect binary tree ______________ .
- A) Leaf nodes are situated at different levels
- B) Internal nodes has exactly two child nodes
- C) Internal nodes has only left child
- D) Internal nodes has only right child
In a perfect binary tree of height h, the total number of nodes N is ___________.
- A) 2h-1 – 1
- B) 2h+1 – 1
- C) 2h+1 + 1
- D) 2h-1 +1
If we want to find median of 50 elements, then after applying buildHeap method, how many times deleteMin method will be called ?
- A) 5
- B) 25
- C) 35
- D) 50
The total number of nodes on 10th level of a perfect binary tree are :
- A) Can't be determined
- B) 512
- C) 256
- D) 1024
In 1990,Bill Pugh proposed an enhancement on linked lists and the new data structure was termed as
- A) Tree List
- B) Fixed list
- C) Enhanced Linked list
- D) Skip list
Binary Search can be categorized into which of the following?
- A) Brute Force technique
- B) Dynamic programming
- C) Greedy algorithm
- D) Divide and conquer
A perfect binary tree is constructed using 131071 nodes then what will be the maximum height of that binary tree?
- A) 17
- B) 15
- C) 16
- D) 14
Suppose there are 100 elements in an equivalence class, so initially there will be 100 trees. The collection of these trees is called ________________.
- A) Cluster
- B) Forest
- C) Bunch
- D) Class
Which of the following statement is NOT correct regarding Table ADT?
- A) In a table, the type of information in columns may be different.
- B) A table consists of several columns, known as entities.
- C) The row of a table is called a record.
- D) A major use of table is in databases where we build and use tables for keeping information.
A table consists of several columns, known as
- A) Entity
- B) Fields
- C) Record
- D) Tuple
Consider a min heap, represented by the following array: 2,5,6,7,8 After calling the function deleteMin().Which of the following is the updated min heap?
- A) 5,7,6,8
- B) 5,8,6,7
- C) 5,7,8,6
- D) 5,6,7,8
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) 6,7,5,4
- C) 4,6,7,5
- D) 4,6,5,7,
For a perfect binary tree of height h, having N nodes, the sum of heights of nodes is _____________.
- A) N – (h - 1)
- B) N – 1 + h
- C) N – h – 1
- D) N – 1
Given the values are the array representation of heap; 12 23 26 31 34 44 56 64 78 100 If we perform 4 deleteMin operations, the last element deleted is__________.
- A) 56
- B) 31
- C) 44
- D) 34
The expression if ( ! heap->isEmpty() ) checks
- A) Heap is not empty
- B) Heap is empty
- C) Not a valid expression
- D) Heap is full
For a perfect binary tree of height h, having N nodes, the sum of heights of nodes is _____________.
- A) N – (h - 1)
- B) N – 1 + h
- C) N – h – 1
- D) N – 1
Given the values are the array representation of heap; 12 23 26 31 34 44 56 64 78 100 If we perform 4 deleteMin operations, the last element deleted is__________.
- A) 56
- B) 31
- C) 44
- D) 34