Q. write a program in C++ to take a input file(input.txt) compare it with the di
ID: 3587422 • Letter: Q
Question
Q. write a program in C++ to take a input file(input.txt) compare it with the dictionary file and output the words misspelled with their corresponding occurence in a output.txt file. also need to have a time complexity table for binary search and sort that contains: n #operations T(n) O(f(n)). Requirements: -need to search clean sorted dictionary only with -sort the dictionary with one slow and and one fast algorithm -need to use recursive algorithm for searching and sorting words in the file to be compared -need to use binary search to find out if a word is misspelt. -output.txt file should contain all the letters in lowercase in short( need one effiecient and one ineffiecient sorting; need to use efficient search(binary search); recursion required, analyze O())
Explanation / Answer
#include #include using namespace std; int main () { streampos size; char * memblock; ifstream file ("example.bin", ios::in|ios::binary|ios::ate); if (file.is_open()) { size = file.tellg(); memblock = new char [size]; file.seekg (0, ios::beg); file.read (memblock, size); file.close(); coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.