An $O(k \log{n})$ algorithm for prefix based ranked autocomplete
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(k \log{n})$, and $O(n)$ extra space for providing the user with the top $k$ ranked suggestions out of a corpus of $n$ possible suggestions based on the prefix of the query that she has entered so far.
- Publication:
-
arXiv e-prints
- Pub Date:
- October 2021
- DOI:
- 10.48550/arXiv.2110.15535
- arXiv:
- arXiv:2110.15535
- Bibcode:
- 2021arXiv211015535M
- Keywords:
-
- Computer Science - Data Structures and Algorithms