diff --git a/docs/Leetcode_Solutions/Python/0208._implement_trie_(prefix_tree).md b/docs/Leetcode_Solutions/Python/0208._implement_trie_(prefix_tree).md index 8ee06db58e1b02a803d26ce478f213436dc4d229..d4afd93baecdfa8ad1b1e72f04bd98596b6853d8 100644 --- a/docs/Leetcode_Solutions/Python/0208._implement_trie_(prefix_tree).md +++ b/docs/Leetcode_Solutions/Python/0208._implement_trie_(prefix_tree).md @@ -1,13 +1,39 @@ -### 208. Implement Trie (Prefix Tree) +# 208. Implement Trie (Prefix Tree) -题目: +**难度: Medium** - +## 刷题内容 +> 原题连接 -难度: +* 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实现也太精美了吧,谷歌复写之