Created
June 24, 2016 13:04
-
-
Save bragboy/cd50cda0636d6a4dc748b393e7e7388c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dsa.tries; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileReader; | |
import java.io.IOException; | |
public class TrieLoader { | |
public static Trie trieDSA; | |
public static void main(String[] args) { | |
TrieLoader trieLoader = new TrieLoader(); | |
trieLoader.load(); | |
new TrieTestFrame(); | |
} | |
public void load(){ | |
trieDSA = new Trie(); | |
BufferedReader br = null; | |
try { | |
br = new BufferedReader(new FileReader(new File("src/properties/words.txt"))); | |
String eachLine = null; | |
while((eachLine=br.readLine())!=null){ | |
trieDSA.insert(eachLine); | |
} | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} finally{ | |
if(br!=null){ | |
try { | |
br.close(); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment