# 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 - The following formular is of

left_subtree (keys) ≤ node (key) ≤ right_subtree (keys)

### Answer : C

### Explanation

A binary search tree (BST) is a tree in which all nodes follows the below mentioned properties −

The left sub-tree of a node has key less than or equal to its parent node's key.

The right sub-tree of a node has key greater than or equal to its parent node's key.

Q 4 - Binary search tree has best case run-time complexity of Ο(log n). What could the worst case?

### Answer : A

### Explanation

In case where binary search tree is left or right intended, the worst case can be Ο(n)

Q 5 - An algorithm is

A - a piece of code to be executed.

B - a loosely written code to make final code.

### Answer : C

### Explanation

An algorithm is a step by step procedure to solve a computer problem.

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 - The Θ notation in asymptotic evaluation represents −

### Answer : A

### Explanation

Θ represents average case. Ο represents worst case and Ω represents base case.

Q 8 - Tower of hanoi is a classic example of

### Answer : D

### Explanation

The recursive approach of tower of hanoi uses divide and conquer method.

Q 9 - A pivot element to partition unsorted list is used in

### Answer : B

### Explanation

The quick sort partitions an array using pivot element and then calls itself recursively twice to sort the resulting two subarray.

Q 10 - Apriori analysis of an algorithm assumes that −

A - the algorithm has been tested before in real environment.

B - all other factors like CPU speed are constant and have no effect on implementation.

### Answer : B

### Explanation

Efficiency of algorithm is measured by assuming that all other factors e.g. processor speed, are constant and have no effect on implementation.