# 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. ### Explanation

Polish Notation

Q 2 - What data structure can be used to check if a syntax has balanced paranthesis ?

A - queue

B - tree

C - list

D - stack

### Explanation

Stack uses LIFO method which is good for checking matching paranthesis.

Q 3 - Minimum number of queues required for priority queue implementation?

A - 5

B - 4

C - 3

D - 2

### Explanation

Minimum number of queues required for priority queue implementation is two. One for storing actual data and one for storing priorities.

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.

Q 5 - Time complexity of Depth First Traversal of is

A - Θ(|V|+|E|)

B - Θ(|V|)

C - Θ(|E|)

D - Θ(|V|*|E|)

### Explanation

Using Depth First Search, we traverse the whole graph i.e. visiting all Vertices and Edges.

Q 6 - Match the following −

 (1) Bubble Sort (A) Ο(n) (2) Shell Sort (B) Ο(n2) (3) Selection Sort (C) Ο(n log n)

A - 1 → A,  2 → B,  3 → C

B - 1 → B,  2 → C,  3 → A

C - 1 → A,  2 → C,  3 → B

D - 1 → B,  2 → A,  3 → C

### Explanation

One pointer variable can not store more than one address values.

### Explanation

Heap maintains itself to meet all the requirements of complete binary tree.

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.

C - spanning will have less edges.

D - spanning will not cover all vertices.