Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use the given class to solve Questions 5 - 8 on the exam. Note that member functions require the appropriate parameters. class Alist private: struct
Use the given class to solve Questions 5 - 8 on the exam. Note that member functions require the appropriate parameters. class Alist private: struct Nodet int data; Node. next; Node head; public: // member functions declared here Write a member function definition that prints all the data in a AList object to the screen in a column. Write a member function that will insert (or add in correct location) a value to an object of type AList. Alist is a linked list of Nodes in nondescending order (ascending with duplicates allowed). Write a member function for AList that deallocates the memory for the entire list (leaving 'head' with the value nullptr afterward). A file order.dat contains some number of integers, stored one per line in nondescending order. A second file unorder.dat contains some number of integers, stored one per line in an unknown order. Write the main function necessary to construct a single linked list containing all the data (from both files) in nondescending order (ascending with duplicates allowed) and print the final list to the screen in a column. Be sure to delete the list when finished. You may use any of the functions written for the previous parts of this question as needed and may assume the protoypes have already been declared. You will need to include the file reading operations and all needed variable declarations
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