Data Structures and Algorithms Quiz

Test your knowledge of data structures including trees, graphs, queues, deques, and sorting algorithms

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

The complexity of merge sort algorithm is

  1. O(n)
  2. O(log n)
  3. O(n2)
  4. O(n log n)
Question 2 Multiple Choice (Single Answer)

Which of the following sorting algorithm is of divide-and-conquer type?

  1. Bubble sort
  2. Insertion sort
  3. Quick sort
  4. All of above
Question 3 Multiple Choice (Single Answer)

An algorithm that calls itself directly or indirectly is known as

  1. Sub algorithm
  2. Recursion
  3. Polish notation
  4. Traversal algorithm
Question 4 Multiple Choice (Single Answer)

In a binary tree, certain null entries are replaced by special pointers which point to nodes higher in the tree for efficiency. These special pointers are called

  1. Leaf
  2. branch
  3. path
  4. thread
Question 5 Multiple Choice (Single Answer)

The in order traversal of tree will yield a sorted listing of elements of tree in

  1. Binary trees
  2. Binary search trees
  3. Heaps
  4. None of above
Question 6 Multiple Choice (Single Answer)

Which of the following data structure is non-linear type?

  1. Strings
  2. Lists
  3. Stacks
  4. None of above
Question 7 Multiple Choice (Single Answer)

Which of the following data structure is linear type?

  1. Strings
  2. Lists
  3. Queues
  4. All of above
Question 8 Multiple Choice (Single Answer)

The depth of a complete binary tree is given by

  1. Dn = n log2n
  2. Dn = n log2n+1
  3. Dn = log2n
  4. Dn = log2n+1
Question 9 Multiple Choice (Single Answer)

When representing any algebraic expression E which uses only binary operations in a 2-tree,

  1. the variable in E will appear as external nodes and operations in internal nodes
  2. the operations in E will appear as external nodes and variables in internal nodes
  3. the variables and operations in E will appear only in internal nodes
  4. the variables and operations in E will appear only in external nodes
Question 10 Multiple Choice (Single Answer)

A binary tree can easily be converted into q 2-tree

  1. by replacing each empty sub tree by a new internal node
  2. by inserting an internal nodes for non-empty node
  3. by inserting an external nodes for non-empty node
  4. by replacing each empty sub tree by a new external node
Question 11 Multiple Choice (Single Answer)

When converting binary tree into extended binary tree, all the original nodes in binary tree are

  1. internal nodes on extended tree
  2. external nodes on extended tree
  3. vanished on extended tree
  4. None of above
Question 12 Multiple Choice (Single Answer)

The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal

  1. ABFCDE
  2. ADBFEC
  3. ABDECF
  4. ABDCEF
Question 13 Multiple Choice (Single Answer)

In a Heap tree

  1. Values in a node is greater than every value in left sub tree and smaller than right sub tree
  2. Values in a node is greater than every value in children of it
  3. Both of above conditions applies
  4. None of above conditions applies
Question 14 Multiple Choice (Single Answer)

In a graph if e=[u, v], Then u and v are called

  1. endpoints of e
  2. adjacent nodes
  3. neighbors
  4. all of above
Question 15 Multiple Choice (Single Answer)

A connected graph T without any cycles is called

  1. a tree graph
  2. free tree
  3. a tree
  4. All of above
Question 16 Multiple Choice (Single Answer)

In a graph if e=(u, v) means

  1. u is adjacent to v but v is not adjacent to u
  2. e begins at u and ends at v
  3. u is processor and v is successor
  4. both b and c
Question 17 Multiple Choice (Single Answer)

If every node u in G is adjacent to every other node v in G, A graph is said to be

  1. isolated
  2. complete
  3. finite
  4. strongly connected
Question 18 Multiple Choice (Single Answer)

Which data structure allows deleting data elements from front and inserting at rear?

  1. Stacks
  2. Queues
  3. Deques
  4. Binary search tree
Question 19 Multiple Choice (Single Answer)

Identify the data structure which allows deletions at both ends of the list but insertion at only one end.

  1. Input-restricted deque
  2. Output-restricted deque
  3. Priority queues
  4. None of above
Question 20 Multiple Choice (Single Answer)

To represent hierarchical relationship between elements, which data structure is suitable?

  1. Deque
  2. Priority
  3. Tree
  4. All of above