retagged by
510 views
2 votes
2 votes

An array ‘A’ of length n contains numbers {0, 1, 2}, numbers are present in array in arbitrary order.

The best sorting algorithms, takes 250 units of time when n = 100. If n = 450. The minimum time required by algorithm on same hardware __________ (Rounded off to integers).

retagged by

1 Answer

Best answer
1 votes
1 votes
The best sort for this is counting sort, which has a time complexity of O(n). As the range is significantly less than the number of inputs.

For 100 inputs => 250 seconds.

Then for 450 inputs => 2.5 x 450 = 1125.
selected by

Related questions

946
views
1 answers
0 votes
raja11sep asked Jan 15, 2022
946 views
Can anyone explain each option, for every option if it is true then why? If false then why? (Please don’t comment like answer is A,B etc) Please help
1.0k
views
1 answers
0 votes
996
views
3 answers
0 votes
889
views
2 answers
1 votes
Ravi Dubey asked Aug 2, 2018
889 views
Could a binary search tree be built using o(n lg n) comparisons in the comparisonmodel? Explain why or why not.