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

Explanation

Polish Notation

Q 2 - A circular linked list can be used for

A - Stack

B - Queue

C - Both Stack & Queue

D - Neither Stack or Queue

Answer : C

Explanation

Both stack and queue data structure can be represented by circular linked-list.

Q 3 - Travelling salesman problem is an example of

A - Dynamic Algorithm

B - Greedy Algorithm

C - Recursive Approach

D - Divide & Conquer

Answer : B

Explanation

Travelling salesman is an example of greedy algorithm. Greedy algorithms tries to find localized optimum solution which may eventually land in globally optimized solutions.

Q 4 - Binary search tree has best case run-time complexity of Ο(log n). What could the worst case?

A - Ο(n)

B - Ο(n2)

C - Ο(n3)

D - None of the above

Answer : A

Explanation

In case where binary search tree is left or right intended, the worst case can be Ο(n)

Answer : C

Explanation

An algorithm is a step by step procedure to solve a computer problem.

Q 6 - What will be the running-time of Dijkstra's single source shortest path algorithm, if the graph G(V,E) is stored in form of adjacency list and binary heap is used −

A - Ο(|V|2)

B - Ο(|V| log |V|)

C - Ο(|E|+|V| log |V|)

D - None of these

Answer : C

Explanation

The runing time will be Ο(|E|+|V| log |V|) when we use adjacency list and binary heap.

Q 7 - Linked list search complexity is

A - Ο(1)

B - Ο(n)

C - Ο(log n)

D - Ο(log log n)

Answer : B

Explanation

Linked lists has search complexity of Ο(n).

Q 8 - In C programming, when we remove an item from bottom of the stack, then −

A - The stack will fall down.

B - Stack will rearranged items.

C - It will convert to LIFO

D - This operation is not allowed.

Answer : B

Explanation

Stack can only be accessed from top of it.

Answer : A

Explanation

BST does not care about complete binary tree properties.

Answer : B

Explanation

A sorting algorithm is said to be adaptive, if it takes advantage of already 'sorted' elements in the list that is to be sorted.

data_structures_algorithms_questions_answers.htm
Advertisements