Analysis of Algorithms and Computational Complexity Questions and Answers

Practice Mode
Showing 10 of 239 questions
Q211
A text is made up of the characters a, b, c, d, e each occurring with the probability 0.12, 0.4, 0.15, 0.08, and .25 respectively. The optional coding technique will have the average length of
  • A 4.78
  • B 3.78
  • C 2.78
  • D 1.78
Answer: Option A
Q212
The order of an algorithm that finds whether a given boolean function of 'n' variables, produces a 1 is
  • A constant
  • B linear
  • C logarithmic
  • D exponential
Answer: Option D
Q213
The best sorting methods if number of swappings done, is the only measure of efficiency is
  • A Bubble sort
  • B Selection sort
  • C Insertion sort
  • D Quick sort
Answer: Option B
Q214
The maximum number of comparisons needed to sort 7 items using radix sort is (assume each item is a 4 digit decimal number)
  • A 280
  • B 40
  • C 47
  • D 38
Answer: Option A
Q215
As part of the maintenance work, you are entrusted with the work of rearranging the library books in a shelf in proper order, at the end of each day. The ideal choice will be
  • A bubble sort
  • B insertion sort
  • C selection sort
  • D heap sort
Answer: Option B
Q216
Which of the following algorithms exhibits the unnatural behaviour that, minimum number of comparisons are needed if the list to be sorted is in the reverse order and maximum number of comparisons are needed if they are already in order?
  • A Heap sort
  • B Radix sort
  • C Binary insertion sort
  • D None of these
Answer: Option C
Q217
The sorting method which sorts a given set of items that is already in order or in reverse order with equal speed is
  • A Heap sort
  • B Quick sort
  • C Insertion sort
  • D Selection sort
Answer: Option B
Q218
Algorithm which solves the all-pair shortest path problem is
  • A Dijkstra's algorithm
  • B Floyd's algorithm
  • C Prim's algorithm
  • D Warshall's algorithm
Answer: Option B
Q219
Stack A has the entries a, b, c (with a on top). Stack B is empty. an entry propped out of stack A can be printed immediately or pushed to stack B. An entry popped out of the stack B can only be printed. IN this arrangement, which of the following permutations of a, b, c are not possible?
  • A b a c
  • B b c a
  • C c a b
  • D a b c
Answer: Option C
Q220
In the previous problem, if the stack A has 4 entries, then the number of possible permutations will be
  • A 24
  • B 12
  • C 21
  • D 14
Answer: Option D
Questions and Answers for Competitive Exams Various Entrance Test