
Trie
文章平均质量分 81
zshouyi
这个作者很懒,什么都没留下…
展开
-
208. Implement Trie (Prefix Tree)
Implement a trie with insert, search, and startsWith methods. Note: You may assume that all inputs are consist of lowercase letters a-z. 设计一个单词搜索树,这里每一个node下面有26个子node,以下一个字母为索引进行保存和查询。代码如下: c原创 2017-05-14 07:07:16 · 264 阅读 · 0 评论 -
211. Add and Search Word - Data structure design
Design a data structure that supports the following two operations: void addWord(word) bool search(word) search(word) can search a literal word or a regular expression string containing only lett原创 2017-05-14 07:44:04 · 376 阅读 · 0 评论 -
421. Maximum XOR of Two Numbers in an Array
Given a non-empty array of numbers, a0, a1, a2, … , an-1, where 0 ≤ ai < 231. Find the maximum result of ai XOR aj, where 0 ≤ i, j n. Could you do this in O(n) runtime? Example: Input:原创 2017-05-28 15:13:30 · 298 阅读 · 0 评论 -
212. Word Search II
Given a 2D board and a list of words from the dictionary, find all words in the board. Each word must be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those hor原创 2017-06-23 01:58:09 · 327 阅读 · 0 评论