logo
Data Structures Algorithms - Quiz(MCQ)
A)
The list must be sorted
B)
There must be mechanism to delete and/or insert elements in list
C)
there should be the direct access to the middle element in any sublist
D)
None of the above

Correct Answer : Option (B) :   There must be mechanism to delete and/or insert elements in list

A)
data collection should be equally distributed but not sorted.
B)
data collection should be in sorted form and equally distributed.
C)
data collection should be in sorted form and but not equally distributed.
D)
None of the above.

Correct Answer : Option (B) :   data collection should be in sorted form and equally distributed.


Explanation : For this algorithm to work properly the data collection should be in sorted form and equally distributed.

A)
parent nodes have values greater than or equal to their childs
B)
parent nodes have values less than or equal to their childs
C)
both statements are true
D)
both statements are wrong

Correct Answer : Option (A) :   parent nodes have values greater than or equal to their childs


Explanation : In a min heap, parents always have lesser or equal values than that of their childs.

A)
list
B)
stack
C)
queue
D)
None of the above

Correct Answer : Option (C) :   queue


Explanation : Queue is used for breadth first traversal whereas stack is used for depth first traversal.

A)
Operations
B)
Algorithms
C)
Storage Structures
D)
None of the above

Correct Answer : Option (D) :   None of the above

A)
Arrays
B)
Records
C)
Pointers
D)
None of the above

Correct Answer : Option (A) :   Arrays

A)
Divide & Conquer
B)
Recursive Approach
C)
Dynamic Algorithm
D)
Greedy Algorithm

Correct Answer : Option (D) :   Greedy Algorithm


Explanation : Travelling salesman is an example of greedy algorithm. Greedy algorithms tries to find localized optimum solution which may eventually land in globally optimized solutions.

A)
Merge Sort
B)
Quick Sort
C)
Bubble Sort
D)
Insertion Sort

Correct Answer : Option (B) :   Quick Sort


Explanation : Among the given, only quick sort is not stable that is it may re-arrange the already sorted items.

A)
quick sort
B)
bubble sort
C)
selection sort
D)
insertion sort

Correct Answer : Option (C) :   selection sort

A)
Ο(1), Ο(n)
B)
Ο(1), Ο(1)
C)
Ο(n), Ο(n)
D)
Ο(n), Ο(1)

Correct Answer : Option (B) :   Ο(1), Ο(1)


Explanation : As queue is maintained by two separate pointers for queue and dequeue operations, the run time for both is Ο(1).