Ebay Interview Question
Software Engineer / DevelopersCountry: United States
Interview Type: Phone Interview
I dont think so.counts.length is a constant- the question states that only single digit numbers are present in the list (0-9). So that keeps the complexity at O(n).
You do not have 'n' numbers with each number having 'n' as its frequency. That would be O(n^2).
Please correct me in case I have messed up.
Counting sort
- Vincent August 08, 2012