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.

Questions and Answers

Answer : B

Explanation

At maximum, a complete graph can have nn - 1 spanning trees.

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

A - queue

B - tree

C - list

D - stack

Answer : D

Explanation

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

Q 3 - A linked-list is a dynamic structure

A - true

B - false

Answer : A

Explanation

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

Q 4 - Minimum number of spanning tree in a connected graph is

A - n

B - nn - 1

C - 1

D - 0

Answer : C

Explanation

Every connected graph at least has one spanning tree.

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

A - 1, 3, 4, 6, 8, 9

B - 9, 8, 6, 4, 3, 1

C - 9, 8, 6, 3, 3, 1

D - 1, 3, 3, 6, 8, 9

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.

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 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

Answer : A

Explanation

Greedy approach focuses only on localized optimum solution.

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.

Answer : D

Explanation

The balance factor (BalanceFactor = height(left-sutree) − height(right-sutree)) is used to check if the tree is balanced or unbalanced.

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.

data_structures_algorithms_questions_answers.htm
Advertisements