# 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 - Which one of the below is not divide and conquer approach?

### Answer : B

### Explanation

Among the options, only Merge sort divides the list in sub-list, sorts and then merges them together

### Answer : B

### Explanation

In queue, data item inserted first, will be available first and data item inserted last will be available in the last. FIFO stands for First In First Out and is a correct answer.

Q 3 - Which of the following asymptotic notation is the worst among all?

### Answer : B

### Explanation

Ο(n+9378) is n dependent

Ο(n^{3}) is cubic

n^{Ο(1)} is polynomial

2^{Ο(n)} is exponential

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

### Answer : C

### Explanation

Worst case height of an AVL tree is 1.44 log n

Q 5 - After each iteration in bubble sort

A - at least one element is at its sorted position.

### 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 - Quick sort running time depends on the selection of

### Answer : B

### Explanation

If the pivot element is balanced, quick sort running time will be less.

Q 7 - A queue data-structure can be used for −

### Answer : C

### Explanation

Queues can be used for limited resource allocation. For other operations, stacks are used.

Q 8 - Recursion uses more memory space than iteration because

A - it uses stack instead of queue.

### Answer : B

### Explanation

Recursion uses stack but the main reason is, every recursive call needs to be stored separately in the memory.

Q 9 - A balance factor in AVL tree is used to check

B - if all child nodes are at same level.

### Answer : D

### Explanation

The balance factor (BalanceFactor = height(left-sutree) − height(right-sutree)) is used to check if the tree is balanced or unbalanced.

Q 10 - Interpolation search is an improved variant of binary search. It is necessary for this search algorithm to work that −

A - data collection should be in sorted form and equally distributed.

B - data collection should be in sorted form and but not equally distributed.

C - data collection should be equally distributed but not sorted.

### Answer : A

### Explanation

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