C++ Binary Tree Sorting of text words

As different authors tend to use different vocabularies and to use common words with differing frequencies. Given an essay or other text, it is interesting to find what distinct words are used and how many times each is used.

I’m trying to produce a driver program and the information-retrieval package using ordinary binary search trees.

I really want to complete this program using the outline I’m presenting you here:
1) Create the data structure (binary search tree).

2) Ask the user for the name of a text file and open it to read.

3) Read the file, split it apart into individual words, and insert the words into the data structure. With each word will be kept a frequency count (how many times the word appears in the input), and when duplicate words are encountered, the frequency count will be increased. The same word will not be inserted twice in the tree.

4) Print the number of comparisons done and the CPU time used in part 3. (By CPU time, I mean the amount of time for which the CPU was used for processing the comparisons (reading the file, splitting & inserting words)).

5) That I can, If I wish, print out all the words in the data structure, in alphabetical
order, with their frequency counts.

6) Put everything in parts 2-5 into a do . . . while loop that will run as many
times as the user wishes. Thus the user can build the data structure with
more than one file if desired. By reading the same file twice, the user can
compare time for retrieval with the time for the original insertion. (Let me clarify here, because parts 2 to 5 will be in a “do while” loop, then I can compare time for retrieval with the time for the original insertion).

Some additional specifications I was trying to implement to the program:
* I want the input to the driver will to be a file. The program will be executed with several different files; the name of the file to be used should be requested from the user while the program is running.

* A word is defined as a sequence of letters, together with apostrophes (‘) and hyphens (-), provided that the apostrophe or hyphen is both immediately preceded and followed by a letter. Uppercase and lowercase letters should be regarded as the same (by translating all letters into either uppercase or lowercase, as you prefer). A word is to be truncated to its first 20 characters (that is, only 20 characters are to be stored in the data structure) but words longer than 20 characters may appear in the text. Non-alphabetic characters (such as digits, blanks, punctuation marks, control characters) may appear in the text file. The appearance of any of these terminates a word, and the next word begins only when a letter appears.

* The program should not allow to be changed at all when I change implementation of data structures later.

Final specifications for the functions to I want implemented first with binary
search trees:
void update(const String &word,
Search_tree< Record > &structure, int &num_comps);

postcondition: If word was not already present in structure, then word has been inserted into structure and its frequency count is 1. If word was already present in structure, then its frequency count has been increased by 1. The variable parameter num_comps is set to the number of comparisons of words done.

void print(const Search_tree< Record > &structure);

postcondition: All words in structure are printed at the terminal in alphabetical order together with their frequency counts.

Calculate the price
Make an order in advance and get the best price
Pages (550 words)
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Upload your instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with TheBestPaperWriters
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
Public Administration
Excellent timely work
Customer 452451, April 19th, 2023
Excellent services will definitely come back
Customer 452441, September 23rd, 2022
Business Studies
Job well done. Finish paper faster than expected. Thank you!
Customer 452451, October 3rd, 2022
Business Studies
Thank you!
Customer 452451, November 27th, 2022
Thanks a lot the paper was excellent
Customer 452453, October 26th, 2022
Job well done and completed in a timely fashioned!
Customer 452451, November 18th, 2022
Business Studies
Excellent service - thank you!
Customer 452469, February 20th, 2023
The paper was EXCELLENT. Thank you
Customer 452449, September 23rd, 2022
English 101
Very good job. I actually got an A
Customer 452443, September 25th, 2022
excellent loved the services
Customer 452443, September 23rd, 2022
Architecture, Building and Planning
The assignment was well written and the paper was delivered on time. I really enjoyed your services.
Customer 452441, September 23rd, 2022
Customer reviews in total
Current satisfaction rate
3 pages
Average paper length
Customers referred by a friend
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat