We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I think a count array of size 201 is the way to go, that gives the best space/time performance. You only need to remember the value of the very first element read which is your pivot. Count of this pivot is stored at the 100th index in the count array. It is guaranteed that all other elements are within +/- 100 range hence 200 slots is the maximum you need.
Missing Numbers
You are viewing a single comment's thread. Return to all comments →
I think a count array of size 201 is the way to go, that gives the best space/time performance. You only need to remember the value of the very first element read which is your pivot. Count of this pivot is stored at the 100th index in the count array. It is guaranteed that all other elements are within +/- 100 range hence 200 slots is the maximum you need.