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 - In order traversal of binary search tree will produce −

A - unsorted list

B - reverse of input

C - sorted list

D - none of the above

Answer : C

Explanation

Binary search tree yields a sorted list when traversed in-order.

Q 2 - Postfix expression is just a reverse of prefix expression.

A - True

B - False

Answer : B

Explanation

Expression notations are not reverse (or so) of each other, rather operators used in the expression have different arrangements.

Q 3 - The following formular is of

left_subtree (keys)  ≤  node (key)  ≤  right_subtree (keys)

A - Bianry Tree

B - Complete Binary Tree

C - Binary Search Tree

D - All of the above

Answer : C

Explanation

A binary search tree (BST) is a tree in which all nodes follows the below mentioned properties −

  • The left sub-tree of a node has key less than or equal to its parent node's key.

  • The right sub-tree of a node has key greater than or equal to its parent node's key.

Q 5 - Time complexity of Depth First Traversal of is

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

B - Θ(|V|)

C - Θ(|E|)

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

Answer : A

Explanation

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

Q 6 - The number of binary trees with 3 nodes which when traversed in post order gives the sequence A,B,C is ?

A - 3

B - 4

C - 5

D - 6

Answer : C

Explanation

Five binary trees (of 3 nodes) are possible.

Q 7 - The Θ notation in asymptotic evaluation represents −

A - Base case

B - Average case

C - Worst case

D - NULL case

Answer : A

Explanation

Θ represents average case. Ο represents worst case and Ω represents base case.

Q 8 - Which of the following algorithm cannot be desiged without recursion −

A - Tower of Hanoi

B - Fibonacci Series

C - Tree Traversal

D - None of the above

Answer : D

Explanation

Every problem which can be solved using recursion can also be solved using iterations.

Answer : A

Explanation

Shell sort uses insertion sort when interval value is 1.

Answer : C

Explanation

A stable sorting algorithm like bubble sort, does not change the sequence of appearance of similar element in the sorted list.

data_structures_algorithms_questions_answers.htm
Advertisements