I'm reading this paper Product quantization for nearest neighbor search.
On the last row of table II page 5 it gives
the complexity given in this table for searching the k smallest elements is the average complexity for n >> k and when the elements are arbitrarily ordered
which is n+klogkloglogn
.
I guess we can use linear selection algorithm to get unsorted k nearest neighbors with O(n)
, and sort the k nearest neighbors with O(klogk)
, so can we have O(n+klogk)
in total. But where does the loglogn
term come from?
The paper gives a reference to the TAOCP book for this, but I don't have the book at hand, could anyone explain it for me?