Analysis of Algorithms and Computational Complexity Questions and Answers

Practice Mode
Showing 10 of 239 questions
Q21
A sort which interactively passes through a list to exchange the first element with any element less than it and then repeats with a new first element is called
  • A insertion sort
  • B selection sort
  • C heap sort
  • D quick sort
Answer: Option B
Q22
A sort which uses the binary tree concept such that any number is larger than all the numbers in the subtree below it is called
  • A selection sort
  • B insertion sort
  • C heap sort
  • D quick sort
Answer: Option C
Q23
The minimum number of fields with each node of doubly linked list is
  • A 1
  • B 2
  • C 3
  • D 4
Answer: Option C
Q24
Let A be a sorted array of n=10 element. Assume that only one comparison is required to determine whether the target is equal to, less than, or greater than A[i]. Which of the following denotes the average successful time of finding an arbitrary element x in A using binary search ?
  • A 1.6
  • B 2.9
  • C 4.2
  • D 5.5
Answer: Option B
Q25
What is the minimum number of edges which must be removed from a complete bipartite graph of six nodes K(6), so that the remaining graph is planar ?
  • A 2
  • B 3
  • C 4
  • D 6
Answer: Option D
Q26
In a complete binary tree of n nodes, how far are the most distant two nodes. Assume that each edge in the path counts as 1. Assume log (n) as log base 2.
  • A about log (n)
  • B about 2 log (n)
  • C about 3 log (n)
  • D about 4 log (n)
Answer: Option B
Q27
Consider a sorted binary insertion tree. what must be done to produce a sorted array of numbers (for printing) from the sorted binary insertion tree ?
  • A pre-order traversal
  • B post-order traversal
  • C in-order traversal
  • D top-down traversal
Answer: Option C
Q28
How many comparisons are needed to sort an array of length 5 if a straight selection sort is used and array is already in the opposite order ?
  • A 1
  • B 10
  • C 15
  • D 20
Answer: Option D
Q29
If memory for the run-time stack is only 150 cells (words), how big can N be in Factorial (N) before encountering stack overflow ?
  • A 24
  • B 66
  • C 15
  • D 66
Answer: Option D
Q30
The number of nodes in the largest maximal independent set of the complete bipartite graph K(4,2) is
  • A 2
  • B 3
  • C 4
  • D 6
Answer: Option C
Questions and Answers for Competitive Exams Various Entrance Test