avatar
f*a
1
类似于这题:
How would you implement live search for people's names (only firstname and
lastname, or lastname and firstname) like in facebook's search, retreiving
the top 5, knowing a value between 0 and 1 for every one of them. If you are
close friends then the value will be bigger. You should output the first 5
values in descending order.
想到trie。找前5怎么在tire上面加数据结构?
avatar
x*0
2
mark
avatar
A*H
3
弄一个priority queue with size of 5, 遍历trie的时候找到match的就丢到queue里
面,

are
5

【在 f********a 的大作中提到】
: 类似于这题:
: How would you implement live search for people's names (only firstname and
: lastname, or lastname and firstname) like in facebook's search, retreiving
: the top 5, knowing a value between 0 and 1 for every one of them. If you are
: close friends then the value will be bigger. You should output the first 5
: values in descending order.
: 想到trie。找前5怎么在tire上面加数据结构?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。