Data Structures Algorithms Online Quiz


Advertisements


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

Q 1 - Which one of the below is not divide and conquer approach?

A - Insertion Sort

B - Merge Sort

C - Shell Sort

D - Heap Sort

Answer : B

Explanation

Among the options, only Merge sort divides the list in sub-list, sorts and then merges them together

Q 2 - Queue data structure works on

A - LIFO

B - FIFO

C - FILO

D - none of the above

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 - Which of the following asymptotic notation is the worst among all?

A - Ο(n+9378)

B - Ο(n3)

C - nΟ(1)

D - 2Ο(n)

Answer : B

Explanation

Ο(n+9378) is n dependent

Ο(n3) is cubic

nΟ(1) is polynomial

2Ο(n) is exponential

Q 4 - What could be the worst case height of an AVL tree?

A - 0.97 log n

B - 2.13 log n

C - 1.44 log n

D - n2 log n

Answer : C

Explanation

Worst case height of an AVL tree is 1.44 log n

Answer : A

Explanation

In one iteration of Bubble sort, the maximum of the set in hand is moved at the end of the unsorted list. Hence one less comparison.

Q 6 - Quick sort running time depends on the selection of

A - size of array

B - pivot element

C - sequence of values

D - none of the above!

Answer : B

Explanation

If the pivot element is balanced, quick sort running time will be less.

Q 7 - A queue data-structure can be used for −

A - expression parsing

B - recursion

C - resource allocation

D - all of the above

Answer : C

Explanation

Queues can be used for limited resource allocation. For other operations, stacks are used.

Answer : B

Explanation

Recursion uses stack but the main reason is, every recursive call needs to be stored separately in the memory.

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

Explanation

For this algorithm to work properly the data collection should be in sorted form and equally distributed.


data_structures_algorithms_questions_answers.htm

Advertisements