Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

what code should be used or add to make the Comparison chart of Linked List vs.

ID: 3545107 • Letter: W

Question

what code should be used or add to make the Comparison chart of Linked List vs. Hash table running times and HashDictionaryTest (( 5 tests )) and HashDictionary implementation for this spell checker code using C++ : P:S the code is working properly , except it doesnt correct the miss spelled word. #include #include #include #include #include #include using namespace std; const int LENGTH=30; int BinarySearch (char ary[][LENGTH], int size, char search_item[LENGTH]); int main () { int n=0, l=0, w=0, pos; char dict[15000][LENGTH]; char word[LENGTH+1]; char c; ifstream fin; fin.open ("dictionary.txt"); for (int len=0; len<=LENGTH; len++) word[len]=NULL; if (fin.fail()) { cout << "Cannot find dictionary file" << endl; } for (n=0; !fin.eof(); n++) { fin.getline(dict[n],LENGTH); } fin.close(); ifstream letter; letter.open ("textcheck.txt"); if (letter.fail()) { cout << "Cannot find draft file" << endl; } for (l=0; !letter.eof(); l++) { letter >> word; for (int a=0; word[a]!=NULL; a++) { while (word[a]) { c=word[a]; word[a]= (tolower(c)); a++; } } pos=BinarySearch(dict, n, word); if (pos==-1) { cout << word << " misspelled!!" << endl; } } letter.close(); { system ("pause"); } return 0; } int BinarySearch (char ary[][LENGTH], int size, char search_item[LENGTH]) { int first = 0, last = size-1; bool found = false; int position = -1, middle; while (!found && first <= last) { middle = (first + last) / 2; if ((strcmp(ary[middle], search_item))==0) { position = middle; found = true; } else if (ary[middle] < search_item) first = middle+1; else last = middle-1; } return position; }

Explanation / Answer

Can you take a screenshot of your code while it's formatted? Much easier to help that way.


Also, you will want to use import a library for time to make the chart and then just use cout for the values