Skip to content

【Day 73 】2021-11-21 - 实现 Trie (前缀树 #92

@azl397985856

Description

@azl397985856

实现 Trie (前缀树

入选理由

暂无

题目地址

leetcode-cn.com/problems/implement-trie-prefix-tree

前置知识

  • Trie

题目描述

实现一个 Trie (前缀树),包含 insert, search, 和 startsWith 这三个操作。

示例:

Trie trie = new Trie();

trie.insert("apple");
trie.search("apple"); // 返回 true
trie.search("app"); // 返回 false
trie.startsWith("app"); // 返回 true1
trie.insert("app");
trie.search("app"); // 返回 true
说明:

你可以假设所有的输入都是由小写字母 a-z 构成的。
保证所有输入均为非空字符串。

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions