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

Q 1 - A procedure that calls itself is called

A - illegal call

B - reverse polish

C - recursive

D - none of the above

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

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

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

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

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

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

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

### Explanation

Tower of hanoi has the highest run time complexity

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

### Explanation

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

## Useful Video Courses

Video

#### Azure Data Lake Online Training

42 Lectures 1.5 hours

Video

#### Data Structure Online Training

141 Lectures 13 hours

Video

#### Oracle Data Guard Online Training

26 Lectures 8.5 hours

Video

#### Big Data & Hadoop Online Training

65 Lectures 6 hours

Video

#### Python with Data Science

75 Lectures 13 hours

Video

#### Mathematics for Data Science and Machine Learning using R

Most Popular

64 Lectures 10.5 hours