ЁЯУв Too many exams? DonтАЩt know which one suits you best? Book Your Free Expert ЁЯСЙ call Now!

  • google app store apple app store
  • тЬЦ

      Question

      Which of the following sorting algorithms has the BEST

      average-case time complexity?
      A Bubble Sort тАФ O(n┬▓) Correct Answer Incorrect Answer
      B Insertion Sort тАФ O(n┬▓) Correct Answer Incorrect Answer
      C Selection Sort тАФ O(n┬▓) Correct Answer Incorrect Answer
      D Merge Sort тАФ O(n log n) Correct Answer Incorrect Answer
      E Gnome Sort тАФ O(n┬▓) Correct Answer Incorrect Answer

      Solution

      Merge Sort consistently achieves O(n log n) in all cases (best, average, worst) using divide-and-conquer. Quick Sort also averages O(n log n) but has O(n┬▓) worst case. Bubble, Insertion, and Selection Sort are all O(n┬▓) average which are inefficient for large datasets.

      Practice Next
      More Algorithms Questions

      Relevant for Exams:

      ask-question