Question
Plz need C++ code with the same output Spellchecker Source code is already given below only need the code in a section where asked to
Plz need C++ code with the same output Spellchecker
Source code is already given below only need the code in a section where asked to fill it up
Specifications
You will be given a menu-driven shell program with a working menu for a rudimentary spellchecker. The spellchecker will use a linear search and a binary search to check the spelling of a word by comparing it to a dictionary of words. Due to memory constraints, the dictionary itself will not be read into memory, but you have been supplied code that will parse the dictionary and save each entry's file position offset to an array. The dictionary is already sorted, and contains only words with lowercase characters.
Be sure you understand how the shell program works, the functions it calls, and the parameters that are passed. You should not need to change any of the shell code. You simply need to provide the missing functionality: A linear search routine (10 pts) and a binary search routine (10 pts). Be sure to test the edge cases (the first word of the file, the last word of the file, and a non-existing word) as well as known words (5 pts). Use only the random file access methods to retrieve data from the open (which the shell code takes care of for you). I would suggest using the getline() function provided by
In your comment header, write a few sentences concerning any performance differences you see between your linear and binary search functions (5 pts). Don't forget to include your name! (2 pts)
Sample input/output
Indexing the word file:
Only needed to fill up the section where it asked to add the c++ code.
source file
// COSC 1437 - Lab 4 (your name here) #include "Header.h" #include
return false; }
Header file
#include
I only posted a words file for only A cause it too long to post all words upto Z.
words.txt file
a aa aaa aah aahed aahing aahs aal aalii aaliis aals aam aardvark aardvarks aardwolf aardwolves aargh aaron aaronic aarrgh aarrghh aas aasvogel aasvogels ab aba abac abaca abacas abacate abacaxi abacay abaci abacinate abacination abacisci abaciscus abacist aback abacli abacot abacterial abactinal abactinally abaction abactor abaculi abaculus abacus abacuses
1. Index the word file 2. Linear search 3. Binary search 4. Quit 1 Enter filename: words.txt Number of words indexed: 355543 1. Index the word file 2. Linear search 3. Binary search 4. Quit 1. Index the word file 2. Linear search 3. Binary search 4. Quit 2 Enter word: a Word found! 1. Index the word file 2. Linear search 3. Binary search 4. Quit 2 Enter word: syzygy Word found! 1. Index the word file 2. Linear search 3. Binary search 4. Quit 2 Enter word: zyzzyvas Word found! 1. Index the word file 2. Linear search 3. Binary search 4. Quit Enter word: laskjdfljk Word not found... 1. Index the word file 2. Linear search 3. Binary search 4. Quit Enter word: a Word found! 1. Index the word file 2. Linear search 3. Binary search 4. Quit Enter word: syzygy Word found! 1. Index the word file 2. Linear search 3. Binary search 4. Quit Enter word: zyzzyvas Word found! 1. Index the word file 2. Linear search 3. Binary search 4. Quit Enter word: lakjsdlfkja Word not found... 1. Index the word file 2. Linear search 3. Binary search 4. QuitStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started