随笔分类 -  Trie

摘要:Given many words, words[i] has weight i. Design a class WordFilter that supports one function, WordFilter.f(String prefix, String suffix). It will ret 阅读全文
posted @ 2019-07-27 14:18 北叶青藤 阅读(282) 评论(0) 推荐(0)
摘要:Design a search autocomplete system for a search engine. Users may input a sentence (at least one word and end with a special character '#'). For each 阅读全文
posted @ 2019-07-15 05:34 北叶青藤 阅读(520) 评论(0) 推荐(0)
摘要:Given N, consider a convex N-sided polygon with vertices labelled A[0], A[i], ..., A[N-1] in clockwise order. Suppose you triangulate the polygon into 阅读全文
posted @ 2019-07-09 09:33 北叶青藤 阅读(654) 评论(0) 推荐(0)
摘要:In English, we have a concept called root, which can be followed by some other words to form another longer word - let's call this word successor. For 阅读全文
posted @ 2019-07-08 05:36 北叶青藤 阅读(188) 评论(0) 推荐(0)
摘要:Design a data structure that supports the following two operations: addWord(word) andsearch(word) search(word) can search a literal word or a regular 阅读全文
posted @ 2016-07-13 05:58 北叶青藤 阅读(253) 评论(0) 推荐(0)