Question
Please help me complete this program in C++: User will provide 2 words; the characters in each word will be loaded into both (1) an
Please help me complete this program in C++:
User will provide 2 words; the characters in each word will be loaded into both (1) an array and (2) a sorted doubly-linked (contains both next and previous pointers) list (two arrays and two doubly-linked lists are used, one array/linked list for each word). Create a struct containing char variable letter and int variable occurrences. Use this structure in the array. For the linked list, use the same struct layout plus pointers to the next and previous elements of the list. Letters can be used more than once in the word but appear only once in the array and list; update occurrences field with count of how many times that letter occurs. Once the arrays and lists are created (1) merge the two arrays into a third array and (2) use overloaded operator += to combine the lists together into one list. Show the contents of all arrays and lists after the words have been read in, and again after they are merged.
Program: User will provide 2 words; the characters in each word will be loaded into both (1) an array and (2) a sorted doubly-linked (contains both next and previous pointers) list (two arrays and two doubly-linked lists are used, one array/linked list for each word) Create a struct containing char variable "letter" and int variable "occurrences". Use this structure in the array. For the linked list, use the same struct layout plus pointers to the next and previous elements of the list. Letters can be used more than once in the word but appear only once in the array and listi update occurrences field with count of how many times that letter occurs. Once the arrays and lists are created (1) merge the two arrays into a third array and (2) use ove r 1 aded perat r += tcombine the lists together int ne list. show the content sf all arrays and lists after the words have been read in, and again after they are mergedStep 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