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 - A procedure that calls itself is called

A - illegal call

B - reverse polish

C - recursive

D - none of the above

Answer : C

Explanation

In recursion, a procedure calls itself, either directly or by calling a procedure which in turn calls it.

Q 2 - What data structure can be used to check if a syntax has balanced paranthesis ?

A - queue

B - tree

C - list

D - stack

Answer : D

Explanation

Stack uses LIFO method which is good for checking matching paranthesis.

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 - Maximum degree of any vertex in a simple graph of vertices n is

A - 2n - 1

B - n

C - n + 1

D - n - 1

Answer : D

Explanation

In a simple graph, a vertex can have edge to maximum n - 1 vertices.

Q 5 - Which of the following has search effeciency of Ο(1) −

A - Tree

B - Heap

C - Hash Table

D - Linked-List

Answer : C

Explanation

A simple hash table has the Ω(1) efficiency.

Q 6 - Which of the below given sorting techniques has highest best-case runtime complexity −

A - quick sort

B - selection sort

C - insertion sort

D - bubble sort

Answer : B

Explanation

Selection sort best case time complexity is Ο(n2)

Q 7 - Which of these alogrithmic approach tries to achieve localized optimum solution −

A - Greedy approach

B - Divide and conquer approach

C - Dynamic approach

D - All of the above

Answer : A

Explanation

Greedy approach focuses only on localized optimum solution.

Q 8 - Program with highest run-time complexity is

A - Tower of Hanoi

B - Fibonacci Series

C - Prime Number Series

D - None of the above

Answer : A

Explanation

Tower of hanoi has the highest run time complexity

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

In this analysis, actual statistics like running time and space required, are collected.

data_structures_algorithms_questions_answers.htm
Advertisements