File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
algorithms/src/main/java/ivanmarkovic/algorithms/trie Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ package ivanmarkovic .algorithms .trie ;
2
+
3
+ public class Main {
4
+
5
+ public static void main (String args []) {
6
+ Trie trie = new Trie ();
7
+ trie .insert ("java" );
8
+ trie .insert ("javascript" );
9
+ trie .insert ("javaee" );
10
+ trie .insert ("scala" );
11
+ trie .insert ("scalable" );
12
+
13
+ System .out .println ("Contains javascript : " + trie .contains ("javascript" ));
14
+ System .out .println ("Contains java : " + trie .contains ("java" ));
15
+ System .out .println ("Any word starts with javasc : " + trie .startsWith ("javasc" ));
16
+ System .out .println ("Any word starts with scal : " + trie .startsWith ("scal" ));
17
+
18
+ System .out .println ("Words starts with java : " + trie .startsWithList ("java" ));
19
+ System .out .println ("Words starts with py : " + trie .startsWithList ("py" ));
20
+
21
+ System .out .println ("Count words : " + trie .countWords ());
22
+ trie .deleteWord ("java" );
23
+ System .out .println ("Words starts with java : " + trie .startsWithList ("java" ));
24
+ System .out .println ("Count words : " + trie .countWords ());
25
+
26
+ }
27
+
28
+ }
You can’t perform that action at this time.
0 commit comments