未验证 提交 fcb5c662 编写于 作者: K Keqi Huang 提交者: GitHub

Update 0208._implement_trie_(prefix_tree).md

上级 455accb2
### 208. Implement Trie (Prefix Tree)
# 208. Implement Trie (Prefix Tree)
题目:
**<font color=orange>难度: Medium</font>**
<https://leetcode.com/problems/implement-trie-prefix-tree/>
## 刷题内容
> 原题连接
难度:
* https://leetcode.com/problems/implement-trie-prefix-tree/
Medium
> 内容描述
```
Implement a trie with insert, search, and startsWith methods.
Example:
Trie trie = new Trie();
trie.insert("apple");
trie.search("apple"); // returns true
trie.search("app"); // returns false
trie.startsWith("app"); // returns true
trie.insert("app");
trie.search("app"); // returns true
Note:
You may assume that all inputs are consist of lowercase letters a-z.
All inputs are guaranteed to be non-empty strings.
```
## 解题方案
> 思路 1
******- 时间复杂度: O(N)******- 空间复杂度: O(N)******
这个Python实现也太精美了吧,谷歌复写之
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册