f********a 发帖数: 165 | 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上面加数据结构? | x*****0 发帖数: 452 | | A*H 发帖数: 127 | 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上面加数据结构?
|
|