Question

# Suppose an array A stores n integers, each of which is in {0, 1, 2, ...,...

Suppose an array A stores n integers, each of which is in {0, 1, 2, ..., 99}. Which of the following sorting algorithms can sort A in O(n) time in the worst case?

Question 16 options:

 A) merge sort
 B) counting sort
 C) quicksort
 D) None of these options is correct.
 E) insertion sort

D) None of these options is correct

As for the comparison just look at the following table which shows the whole scenario of sorting algorithm time complexity of worst-case time complexity column for each sorting algorithm.

Algorithm Data structure Time complexity:Best Time complexity:Average Time complexity:Worst Space complexity:Worst
Quick sort Array O(n log(n)) O(n log(n)) O(n2) O(n)
Merge sort Array O(n log(n)) O(n log(n)) O(n log(n)) O(n)
Insertion sort Array O(n) O(n2) O(n2) O(1)
Count Sort Array Ω(N + k) Θ(N + k) O(N + k) O(k=n)

Thanks

#### Earn Coins

Coins can be redeemed for fabulous gifts.

##### Need Online Homework Help?

Most questions answered within 1 hours.

##### Active Questions
• Hypothesis Test: In a blinded crossover trial, a diet of almonds and its effect on LDL-C,...
• Emerald Co. uses a perpetual inventory system and records purchases of merchandise at net cost. The...
• Movie stars and U.S. presidents have fished Pyramid Lake. It is one of the best places...
• what advantages do percent distributions have over frequency distributions when comparing populations at different years?
• Richard has just been given a 6-question multiple-choice quiz in his history class. Each question has...
• Write about westernized elements in life; westernization in our life, and this includes Americanization.