Data Structures Algorithms Online Quiz


Advertisements


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.

Q 3 - Minimum number of moves required to solve a Tower of Hanoi puzzle is

A - 2n2

B - 2n-1

C - 2n - 1

D - 2n - 1

Answer : C

Explanation

Minimum number of moves required to solve a Tower of Hanoi puzzle is 2n - 1. Where n is the number of disks. If the number of disks is 3, then minimum number of moves required are 23 - 1 = 7

Q 4 - What could be the worst case height of an AVL tree?

A - 0.97 log n

B - 2.13 log n

C - 1.44 log n

D - n2 log n

Answer : C

Explanation

Worst case height of an AVL tree is 1.44 log n

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

All possible spanning trees of graph G, have same number of edges and vertices.

Q 9 - From a complete graph, by removing maximum _______________ edges, we can construct a spanning tree.

A - e-n+1

B - n-e+1

C - n+e-1

D - e-n-1

Answer : A

Explanation

We can remove maximum e-n+1 edges to get a spanning tree from complete graph. Any more deletion of edges will lead the graph to be disconnected.

Answer : B

Explanation

Efficiency of algorithm is measured by assuming that all other factors e.g. processor speed, are constant and have no effect on implementation.


data_structures_algorithms_questions_answers.htm

Advertisements