Write a spell checker, that is, a program that reads the words in a piece of tex
ID: 3567538 • Letter: W
Question
Write a spell checker, that is, a program that reads the words in a piece of text and looks up
each of them in a dictionary to check its spelling. Use a BST to store this dictionary, reading the
list of words from a file. While checking the spelling of words in a piece of text, the program
should print a list of all words not found in the dictionary.
Requirements:
1. Use linked implementation of BST.
2. Construct the tree by inserting the words read from a text file. Your program should
prompt the user for the file name and path. A listing of the dictionary should be printed
on screen before spell checking. A sample dictionary file is provided.
3. The piece of text for which words are checked should be read from a text file as well,
and your program should prompt the user for the input file name and path. The entire
text to check should be printed on screen, followed by the listing of the words that are
not found in the dictionary. A sample input text file is provided.
4. Spell checking is case sensitive.
5. Write a C++ program and use Visual Studio 2012 to test your program. When testing
your program, use
Explanation / Answer
/* * C++ Program to Implement a Binary Search Tree using Linked Lists */ #include using namespace std; #include struct tree { tree *l, *r; int data; }*root = NULL, *p = NULL, *np = NULL, *q; void create() { int value,c = 0; while (c < 7) { if (root == NULL) { root = new tree; coutroot->data; root->r=NULL; root->l=NULL; } else { p = root; coutvalue; while(true) { if (value data) { if (p->l == NULL) { p->l = new tree; p = p->l; p->data = value; p->l = NULL; p->r = NULL; coutl; } } else if (value > p->data) { if (p->r == NULL) { p->r = new tree; p = p->r; p->data = value; p->l = NULL; p->r = NULL; coutr; } } } } c++; } } void inorder(tree *p) { if (p != NULL) { inorder(p->l); coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.