Sorting Algorithm Efficiency Quiz: Big-O Showdown! Quiz

  1. Bubble Sort Worst Case

    What is the Big-O notation for the worst-case time complexity of the bubble sort algorithm?

    1. O(n)
    2. O(log n)
    3. O(n^2)
    4. O(n log n)
    5. O(2^n)
  2. Merge Sort Efficiency

    What is the Big-O notation for the time complexity of merge sort in all cases (best, average, and worst)?

    1. O(n)
    2. O(n^2)
    3. O(log n)
    4. O(n log n)
    5. O(1)
  3. Quick Sort Average Case

    What is the Big-O notation for the average-case time complexity of the quicksort algorithm?

    1. O(n)
    2. O(n^2)
    3. O(log n)
    4. O(n log n)
    5. O(2n)
  4. Insertion Sort Efficiency

    For a nearly sorted list, which of the following sorting algorithms typically performs the best in terms of time complexity?

    1. Bubble Sort
    2. Merge Sort
    3. Quick Sort
    4. Insertion Sort
    5. Selection Sort
  5. Selection Sort Complexity

    What is the Big-O notation for the time complexity of the selection sort algorithm?

    1. O(n)
    2. O(log n)
    3. O(n log n)
    4. O(n^2)
    5. O(n!)
  6. Heap Sort Time

    What is the Big-O notation for the time complexity of heap sort?

    1. O(n)
    2. O(n^3)
    3. O(n log n)
    4. O(n^2)
    5. O(sqrt(n))
  7. Space Complexity - Merge Sort

    Which of the following accurately describes the space complexity associated with Merge Sort?

    1. O(1)
    2. O(log n)
    3. O(n)
    4. O(n log n)
    5. O(n^2)
  8. Quick Sort Worst Case

    In what scenario does Quick Sort exhibit its worst-case time complexity of O(n squared)?

    1. When the input is randomly ordered
    2. When the input is already sorted
    3. When the pivot is always the median
    4. When the input size is small
    5. When using a stable sorting method
  9. Algorithm Suitability

    Which sorting algorithm is most suitable for sorting a linked list efficiently?

    1. Bubble Sort
    2. Selection Sort
    3. Quick Sort
    4. Merge Sort
    5. Heap Sort
  10. Radix Sort

    What is the time complexity of Radix Sort, assuming a fixed key length k, and n elements?

    1. O(n)
    2. O(k log n)
    3. O(n + k)
    4. O(nk)
    5. O(n^2)