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 - Postfix expression is just a reverse of prefix expression.

A - True

B - False

Answer : B

Explanation

Expression notations are not reverse (or so) of each other, rather operators used in the expression have different arrangements.

Answer : D

Explanation

Quick sort divides the list using pivot and then sorts in recursive manner. It uses divide and conquer approach.

Q 4 - Which of the following algorithm is not stable?

A - Bubble Sort

B - Quick Sort

C - Merge Sort

D - Insertion Sort

Answer : B

Explanation

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

Answer : A

Explanation

In one iteration of Bubble sort, the maximum of the set in hand is moved at the end of the unsorted list. Hence one less comparison.

Q 6 - Which of the below mentioned sorting algorithms are not stable?

A - Selection Sort

B - Bubble Sort

C - Merge Sort

D - Insertion Sort

Answer : A

Explanation

Except selection sort, all other soring algorithms are stable.

Q 7 - Index of arrays in C programming langauge starts from

A - 0

B - 1

C - either 0 or 1

D - undefined

Answer : A

Explanation

Arrays, in C, starts from 0 which is mapped to its base address.

Answer : A

Explanation

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

Answer : A

Explanation

Shell sort uses insertion sort when interval value is 1.

Answer : A

Explanation

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

data_structures_algorithms_questions_answers.htm
Advertisements