【发布时间】:2023-08-27 14:53:02
【问题描述】:
谁能帮助我如何在 Trie 中添加对数据结构非常新的单词
/**
* This method adds a word to the Trie
*
* @param s - word to add to the Trie
* @param data - Data associated with word s
*/
public void addWord(String s, E data) {
}
【问题讨论】:
-
您打算自己创建 Trie 数据结构吗?
-
告诉我们你做了什么。
-
*中有一篇 Trie 文章 - en.wikipedia.org/wiki/Trie#Algorithms,您可以在其中找到插入操作的伪代码。
-
@Kunal 是的,我需要使用扫描仪在其中添加单词,但我不知道该怎么做。
标签: java algorithm data-structures java.util.scanner trie