摘要: 题目链接 208. 实现 Trie (前缀树) 思路 字典树与多叉树非常类似,但是它本身结点不存储值。 什么意思呢? 多叉树结点一般是这样的: class Tree{ int value; Tree[] next; } 而字典树的结点一般是这样的: class Trie{ boolean isEnd 阅读全文
posted @ 2023-03-01 09:35 Frodo1124 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 题目链接 79. 单词搜索 思路 DFS 模板题 代码 class Solution { public boolean exist(char[][] board, String word) { int m = board.length; int n = board[0].length; boolea 阅读全文
posted @ 2023-03-01 07:37 Frodo1124 阅读(20) 评论(0) 推荐(0) 编辑