# 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 run-time complexity of binary search algorithm?

A - Ο(n2)

B - Ο(nlog n)

C - Ο(n3)

D - Ο(n)

### Explanation

In the worst case, binary search will be left or right intended, making it compare all the n values.

Q 2 - Maximum number of nodes in a binary tree with height k, where root is height 0, is

A - 2k − 1

B - 2k+1 − 1

C - 2k-1 + 1

D - 2k − 1

### Explanation

If the root node is at height 0, then a binary tree can have at max 2k+1 − 1 nodes.

For example: a binary tree of height 1, can have maximum 21+1 − 1 = 3 nodes.

```   r    --------- 0
/ \
L   R  --------- 1
```

Q 3 - A linked-list is a dynamic structure

A - true

B - false

### Explanation

A linked-list is dynamic structure, it can shrink and expand as required by the program.

Q 4 - Maximum degree of any vertex in a simple graph of vertices n is

A - 2n - 1

B - n

C - n + 1

D - n - 1

### Explanation

In a simple graph, a vertex can have edge to maximum n - 1 vertices.

### Explanation

As trees do not have loops, they are easier to traverse.

Q 6 - Time required to merge two sorted lists of size m and n, is

A - Ο(m | n)

B - Ο(m + n)

C - Ο(m log n)

D - Ο(n log m)

### Explanation

The time required to merge two sorted list is Ο(m + n).

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 - If there's no base criteria in a recursive program, the program will

A - not be executed.

B - execute until all conditions match.

C - execute infinitely.

D - obtain progressive approach.

### Explanation

Without a base criteria and progressive approach, a recursion is just an infinite iteration.