Question
c++ question Do Appendix X.24 Exercise [9] in http://www.stroustrup.com/4thExercises.pdf with the following modifications: Instead of a program not using an associative array, you will (i)
c++ question
Do Appendix X.24 Exercise [9] in http://www.stroustrup.com/4thExercises.pdf with the following modifications:
Instead of a program not using an associative array, you will (i) use std::map, and (ii) implement a binary search tree derived from the binary tree class you used for HW2. You will also implement an overloaded ++ operator to find and return the successor node.
With (ii), you will construct two different binary search trees: one will be produced by inserting the key string and/or updating the int value as your program reads in and processes the input; the other will be produced by building a nearly complete binary search tree from the (already-constructed) Assoc object after you sort it using std::sort.
When your program counts the occurrences of each word in input, make it treat upper- and lower-case versions of a letter to be the same letter, and ignore punctuation marks.
Your program should prompt for an input file name that contains input text. Your program should output the resultsa listing of [word, word-count] pairs written to four separate files, from Assoc, std::map, and two binary search tree objectsusing a range-for statement for Assoc and std::map implementations, and using the overloaded ++ operator as your program traverses each binary search tree from the minimum node to the maximum node. Your program should also output each binary search tree using the level-order traversal.
Step 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