# 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 - What is the worst case time complexity of linear search algorithm?

### Answer : D

### Explanation

Linear search scans sequentially to find the target value. The best case is Ο(1) and average and worst case is Ο(n). Worst case is when data is not in the list, and it has to scan all n elements.

Q 2 - A circular linked list can be used for

### Answer : C

### Explanation

Both stack and queue data structure can be represented by circular linked-list.

Q 3 - The following formula will produce

F_{n}= F_{n-1}+ F_{n-2}

### Answer : B

### Explanation

Fibonacci Series generates subsequent number by adding two previous numbers.

Q 4 - Which of the following searching techniques do not require the data to be in sorted form

### Answer : A

### Explanation

Both binary and interpolation search requires data set to be in sorted form. Linear search can work even if the data is not sorted.

Q 5 - Which of the below given series is Non-Increasing Order −

### Answer : C

### Explanation

A sequence of values is said to be in non-increasing order, if the successive element is less than or equal to its previous element in the sequence.

Q 6 - In context with time-complexity, find the odd out −

A - Deletion from Linked List.

### Answer : D

### Explanation

Binary heap heapify operation has time-complexity of Ο(n), while other operations have time-complexity of Ο(1) only.

Q 7 - If queue is implemented using arrays, what would be the worst run time complexity of queue and dequeue operations?

### Answer : D

### Explanation

As queue is maintained by two separate pointers for queue and dequeue operations, the run time for both is Ο(1).

Q 8 - In a min heap

A - minimum values are stored.

B - child nodes have less value than parent nodes.

### Answer : C

### Explanation

In a min heap, parent nodes store lesser values than child nodes. The minimum value of the entire heap is stored at root.

Q 9 - If we choose Prim's Algorithm for uniquely weighted spanning tree instead of Kruskal's Algorithm, then

A - we'll get a different spanning tree.

B - we'll get the same spanning tree.

### Answer : B

### Explanation

Regardless of which algorithm is used, in a graph with unique weight, resulting spanning tree will be same.

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

### Answer : D

### Explanation

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