The solution to have O(1) read time and O(k) query time is a sparse array?
(Java) 15.9 Variant
It is pretty simple that you just use a hash table for storing results, and traditional selection algorithm for most visited page.
0 Likes
hdchen
#5
@tsunghsienlee can you elaborate ‘traditional selection algorithm’ part? I was wondering how it can achieve O(k) query time (suppose m >> k), thanks.
0 Likes