Question: You are given an integer array A of size n. You know in advance that O(n) elements of A can be larger than 2021n55n, and

You are given an integer array A of size n. You know in advance that O(n) elements of A can be larger than 2021n55n, and the remaining elements of A are in the range [1;2021n55n]. It turns out that, in this case, A can be sorted in O(n) time in the worst case! Please provide such an algorithm. Prove that your sorting algorithm is correct and prove its running time. Hint: a part of your algorithm should use radix sort
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
