Write a C/C++ program to maintain a fixed size library of 1024 documents, whose size randomly ranges between 2MB to 3MB. This library is managed in a FIFO fashion. The software also maintains a separate, fixed size C-style struct (named recent_list) containing 128 pointers that points to a different set of individually initialized documents, whose size randomly ranges between 2MB to 3MB.
Separately, the software maintains a dictionary of words: FIRST, CPP, REVIEW, PROGRAM, ASSIGNMENT, CECS, BEACH, ECS, FALL, SPRING, OS, MAC, LINUX, WINDOWS, LAB. A randomly chosen word from the dictionary is searched (FIFO, i.e. pointer 0 to pointer 127) in every document of the recent_list struct. A document in the recent_list struct whose substring(s) does not match the searched word is ejected/moved to the end of the library & reinitialized (same length), and the first document from the library is copied to the end of the recent_list. Therefore, the documents in each list would be constantly shifting relatively. For example, the documents copied from the library to the recent_list are inserted in the same order that they were copied.
For the program demonstration:
Prompt the user to enter a word from the dictionary (until the user chooses to quit). Search for the word in the currently updated recent_list. Your program outputs the selected word and the number of documents in the recent_list that were ejected.
CPP: 0 document ejected ASSIGNMENT: 3 documents ejected & reinitialized Edit
TutorTeddy.com & Boston Predictive Analytics
[ Email your Statistics or Math problems to email@example.com (camera phone photos are OK) ]
Boston Office (Near MIT/Kendall 'T'):
Cambridge Innovation Center,
One Broadway, 14th Floor,
Cambridge, MA 02142,
Dallas Office (Near Galleria):
15950 Dallas Parkway,
Dallas, TX 75248,