Header Ads Widget

Algorithm Multiple choice question part-1

  1. What is the purpose of worst-case analysis in algorithm analysis? A) To calculate the average time taken by the algorithm B) To calculate the best-case scenario for the algorithm C) To calculate the upper bound on running time of the algorithm D) To calculate the lower bound on running time of the algorithm Answer: C

  2. In which type of analysis, all possible inputs are considered to calculate the computing time for an algorithm? A) Best-case analysis B) Worst-case analysis C) Average-case analysis D) None of the above Answer: C

  3. Which notation defines an exact asymptotic behavior of a function, bounding it from above and below? A) Big O notation B) Ω notation C) Θ notation D) All of the above Answer: C

  4. Which notation provides an asymptotic upper bound on a function? A) Big O notation B) Ω notation C) Θ notation D) None of the above Answer: A

  5. Which notation provides an asymptotic lower bound on a function? A) Big O notation B) Ω notation C) Θ notation D) None of the above Answer: B

  6. Which method for solving recurrences involves making a guess for the solution and using mathematical induction to prove it? A) Substitution method B) Recurrence tree method C) Master theorem method D) None of the above Answer: A

  7. Which method for solving recurrences involves drawing a recurrence tree and calculating the time taken by every level of the tree? A) Substitution method B) Recurrence tree method C) Master theorem method D) None of the above Answer: B

  8. Which method for solving recurrences is applicable only to recurrences of the form T(n) = aT(n/b) + f(n) where a ≥ 1 and b > 1? A) Substitution method B) Recurrence tree method C) Master theorem method D) None of the above Answer: C

  9. What is the purpose of the Master theorem method? A) To calculate the exact asymptotic behavior of a function B) To calculate an upper bound on the running time of an algorithm C) To solve recurrences of the form T(n) = aT(n/b) + f(n) D) None of the above Answer: C

  10. Which notation is used to describe the exact asymptotic behavior of an algorithm? A) Big O notation B) Ω notation C) Θ notation D) None of the above Answer: C

  11. Which notation is used to describe the upper bound on the running time of an algorithm? A) Big O notation B) Ω notation C) Θ notation D) None of the above Answer: A

  12. Which notation is used to describe the lower bound on the running time of an algorithm? A) Big O notation B) Ω notation C) Θ notation D) None of the above Answer: B

  13. Which method for solving recurrences is used to find the lower bound on the running time of an algorithm? A) Substitution method B) Recurrence tree method C) Master theorem method D) None of the above Answer: B

  14. Which method for solving recurrences is used to find the upper bound on the running time of an algorithm? A) Substitution method B) Recurrence tree method C) Master theorem method D) None of the above Answer: C


  Pre  ðŸ‘ˆ                                👉  Next