Hacker News new | ask | show | jobs
by pradeep_m 3244 days ago
I think the code is written for the case where it fits in memory. For that case, the solution is O(n) in terms of time complexity. From the feedback it seems that they only spoke about the solution where the data doesn't fit in memory.
1 comments

"To test further, I asked her how she will approach the problem if the array was too big to fit in memory ... She then worked on adapting her original code to work with left and right batches, swapping ... back to disk." (Emphasis mine.)