Question: // Create a spell checker that find all misspelled words (e.g. non-existing words). // Compare performance of the TST and Trie on various dictionary sizes.
// Create a spell checker that find all "misspelled" words (e.g. non-existing words). // Compare performance of the TST and Trie on various dictionary sizes.


// TODO: Create a Trie from the dictionary, and find all non-existing words in the input text file.
// TODO: Create a TST from the dictionary, and find all non-existing words in the input text file.
1 package algs52; // section 5.2 20 import java.util. HashSet; 3 import stdlib.*; 4 5 // Create a spell checker that find all "misspelled" words (e.g. non-existing words). 6 // Compare performance of the TST and Trie on various dictionary sizes. 7 8 // Download and install the following files into your algs4/data directory: 9 // - https://introcs.cs.princeton.edu/java/data/commonwords.txt 74K words 10 // - https://introcs.cs.princeton.edu/java/data/wordlist.txt 224K words 11 // - https://introcs.cs.princeton.edu/java/data/words.utf-8.txt 645K words 12 // 13 // Expected output should be similar in performance: 14 // 15 // Triest TST 16 // Words Time Words Time 17 // 23699 0.40 23699 0.18 43% 18 // 25913 0.53 25913 0.34 63% 19 // 18075 1.15 18075 0.86 74% 20 21 22 public class hw7 23 public 240 public static HashSet
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
