Sunny Srivastava
Sunny Srivastava

Reputation: 21

Sorting without using divide and conquer algos in less than n*n time

Consider the following input : 8,4,15,9,32,44,55

Propose an algorithm to sort these in ascending order in less than n*n time complexity. Without using any divide and conquer approach

Upvotes: 0

Views: 109

Answers (1)

amit
amit

Reputation: 178411

For relatively small integers such as these you can use bucket sort or radix sort, it will be O(n), and is not devide and conquer.

For larger ints it is still possible, but bucket sort will consume too much space, and radix sort will be O(n*d), where d is the number of digits in the biggest number.

Upvotes: 1

Related Questions