Data Structures Algorithms Online Quiz


Following quiz provides Multiple Choice Questions (MCQs) related to Data Structures Algorithms. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - Which one of the below is not divide and conquer approach?

A - Insertion Sort

B - Merge Sort

C - Shell Sort

D - Heap Sort

Answer : B

Explanation

Among the options, only Merge sort divides the list in sub-list, sorts and then merges them together

Q 2 - A circular linked list can be used for

A - Stack

B - Queue

C - Both Stack & Queue

D - Neither Stack or Queue

Answer : C

Explanation

Both stack and queue data structure can be represented by circular linked-list.

Answer : C

Explanation

Floyd-Warshall's All pair shortest path Algorithm uses dynamic programming approach. All other mentioned algorithms use greedy programming approach

Q 4 - Which of the following searching techniques do not require the data to be in sorted form

A - Binary Search

B - Interpolation Search

C - Linear Search

D - All of the above

Answer : A

Explanation

Both binary and interpolation search requires data set to be in sorted form. Linear search can work even if the data is not sorted.

Q 5 - Which of the following is example of in-place algorithm?

A - Bubble Sort

B - Merge Sort

C - Insertion Sort

D - All of the above

Answer : B

Explanation

Only Merge sort requires extra space.

Q 6 - Quick sort running time depends on the selection of

A - size of array

B - pivot element

C - sequence of values

D - none of the above!

Answer : B

Explanation

If the pivot element is balanced, quick sort running time will be less.

Answer : A

Explanation

After applying node.next -> node.next.next; we will not have node.next stored anywhere if not explicitly mentioned.

Answer : C

Explanation

In a min heap, parent nodes store lesser values than child nodes. The minimum value of the entire heap is stored at root.

Answer : A

Explanation

BST does not care about complete binary tree properties.

Q 10 - Which of the following algorithm does not divide the list −

A - linear search

B - binary search

C - merge sort

D - quick sort

Answer : A

Explanation

Linear search, seaches the desired element in the target list in a sequential manner, without breaking it in any way.

data_structures_algorithms_questions_answers.htm
Advertisements