What are the rules for the “Ω(n log n) barrier” for sorting algorithms?
To directly answer your question: Your sorting algorithm is technically not O(n) but rather O(n + max), since you need to create an array of size max, which takes O(max) time. This isn’t a problem; in fact, it’s a special case of a well-known sorting algorithm that breaks the Ω(n log n) barrier. So what … Read more