# 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 complete graph can have

### Answer : B

### Explanation

At maximum, a complete graph can have n^{n - 1} spanning trees.

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.

### Answer : A

### Explanation

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

Q 4 - What is not true about insertion sort?

A - Exhibits the worst case performance when the initial array is sorted in reverse order.

B - Worst case and average case performance is Ο(n^{2})

C - Can be compared to the way a card player arranges his card from a card deck.

### Answer : D

### Explanation

All given options are true about insertion sort.

Q 5 - What about recursion is true in comparison with iteration?

A - very expensive in terms of memory.

C - every recursive program can be written with iteration too.

### Answer : D

### Explanation

Recursion is just an other way to write the same program code. But calling a function again and again makes it expensive in terms of memory, CPU cycles and delivers less performance.

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 - Which of the following is not possible with an array in C programming langauge −

### Answer : C

### Explanation

Array in C are static and cannot be shrinked or expanded in run-time.

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.

### Answer : B

### Explanation

AVL rotations have complexity of Ο(log n)

Q 10 - In conversion from prefix to postfix using stack data-structure, if operators and operands are pushed and popped exactly once, then the run-time complexity is −

### Answer : B

### Explanation

Infix to postfix conversion using stack will have run time complexity of Ο(n).