MCPcopy Create free account
hub / github.com/Seogeurim/CS-study / TrieExample

Class TrieExample

contents/data-structure/code/Trie/TrieExample.java:3–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1package Trie;
2
3public class TrieExample {
4
5 public static void main(String[] args) {
6 Trie t = new Trie();
7
8 /* insert words */
9 t.insert("a");
10 t.insert("inn");
11 t.insert("to");
12 t.insert("tea");
13 t.insert("ted");
14 t.insert("ten");
15
16 /* search words */
17 System.out.println(t.checkWord("inn"));
18 System.out.println(t.checkWord("tea"));
19 System.out.println(t.checkWord("tee"));
20 System.out.println(t.checkWord("te"));
21 }
22}
23
24class Trie {
25 TrieNode root = new TrieNode();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected