3 ms·
The thing is that in this scenario you need to consider the worst case access, not the average. So instead of O(1) accesses you're stuck with O(n).
by mungoman2 4y ago
The thing is that in this scenario you need to consider the worst case access, not the average. So instead of O(1) accesses you're stuck with O(n).