English

An $O(k \log{n})$ algorithm for prefix based ranked autocomplete

Data Structures and Algorithms 2021-11-01 v1

Abstract

Many search engines such as Google, Bing & Yahoo! show search suggestions when users enter search phrases on their interfaces. These suggestions are meant to assist the user in finding what she wants quickly and also suggesting common searches that may result in finding information that is more relevant. It also serves the purpose of helping the user if she is not sure of what to search for, but has a vague idea of what it is that she wants. We present an algorithm that takes time proportional to O(klogn)O(k \log{n}), and O(n)O(n) extra space for providing the user with the top kk ranked suggestions out of a corpus of nn possible suggestions based on the prefix of the query that she has entered so far.

Keywords

Cite

@article{arxiv.2110.15535,
  title  = {An $O(k \log{n})$ algorithm for prefix based ranked autocomplete},
  author = {Dhruv Matani},
  journal= {arXiv preprint arXiv:2110.15535},
  year   = {2021}
}
R2 v1 2026-06-24T07:17:07.344Z