Skip to content
Snippets Groups Projects
Commit fa286f2d authored by Adam Blank's avatar Adam Blank
Browse files

Adds bst and avl constructor methods to NGramTester

parent 5ca181fe
No related branches found
No related tags found
No related merge requests found
......@@ -3,10 +3,12 @@ package p2.clients;
import java.io.IOException;
import java.util.function.Supplier;
import cse332.datastructures.trees.BinarySearchTree;
import cse332.interfaces.misc.BString;
import cse332.interfaces.misc.Dictionary;
import cse332.types.AlphabeticString;
import cse332.types.NGram;
import datastructures.dictionaries.AVLTree;
import datastructures.dictionaries.ChainingHashTable;
import datastructures.dictionaries.HashTrieMap;
import p2.wordsuggestor.WordSuggestor;
......@@ -20,6 +22,17 @@ public class NGramTester {
Supplier<Dictionary<K, V>> constructor) {
return () -> new ChainingHashTable<K, V>(constructor);
}
@SuppressWarnings({ "rawtypes", "unchecked" })
public static <K, V> Supplier<Dictionary<K, V>> binarySearchTreeConstructor() {
return () -> new BinarySearchTree();
}
@SuppressWarnings({ "rawtypes", "unchecked" })
public static <K, V> Supplier<Dictionary<K, V>> avlTreeConstructor() {
return () -> new AVLTree();
}
public static void main(String[] args) {
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment