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 - 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 is used for breadth first traversal of a graph?

A - queue

B - stack

C - list

D - none of the above

Answer : A

Explanation

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

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 - Minimum number of spanning tree in a connected graph is

A - n

B - nn - 1

C - 1

D - 0

Answer : C

Explanation

Every connected graph at least has one spanning tree.

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 - 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 - 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

Answer : A

Explanation

BST does not care about complete binary tree properties.

Q 10 - If the data collection is in sorted form and equally distributed then the run time complexity of interpolation search is −

A - Ο(n)

B - Ο(1)

C - Ο(log n)

D - Ο(log (log n))

Answer : D

Explanation

Runtime complexity of interpolation search algorithm is Ο(log (log n)) as compared to Ο(log n) of BST in favourable situations.

data_structures_algorithms_questions_answers.htm

Useful Video Courses


Video

Azure Data Lake Online Training

42 Lectures 1.5 hours

Ravi Kiran

Video

Data Structure Online Training

141 Lectures 13 hours

Arnab Chakraborty

Video

Oracle Data Guard Online Training

26 Lectures 8.5 hours

Parth Panjabi

Video

Big Data & Hadoop Online Training

65 Lectures 6 hours

Arnab Chakraborty

Video

Python with Data Science

75 Lectures 13 hours

Eduonix Learning Solutions

Video

Mathematics for Data Science and Machine Learning using R

Most Popular

64 Lectures 10.5 hours

Eduonix Learning Solutions

Advertisements