Homework 3 Build and process a sorted linked list. Rewrite

You Are Eligible For 15% Discount This Month!

Homework 3: Build and process a sorted linked list. Rewrite the first homework assignment(attached below) according to the following specifications (you can also see these specifications in the PDF file). (DO NOT USE VECTOR LIBRARY AS NOT USED IN THE FIRST ASSIGNMENT.)A. Reads data from a text file (mountains.txt) and inserts them into a circularly sorted doubly-linked list with a sentinel node. The list is to be sorted in ascending order by the mountain name named name (a unique key). The Mountain class has four data members:name (string) elevation (int) range(string) state (string)B. Prints the list as a table with four columns (header included) in ascending order.C. Prints the list as a table with four columns (header included) in descending order.D. Prints the number of items in the list.E. Searches the list: prompts the user to enter the name of the mountain or QUIT to stop searching; searches for that name: if found, displays its’ data, otherwise displays some message, such as “… Not found”F. Deletes nodes from the list: prompts the user to enter the name of the mountain to be deleted from the list or QUIT to stop deleting.G. Prints the number of items in the list.H. Prints the list as a table with four columns (header included)I. Prints the list as a table with four columns (header included) in descending order.J. Destroys the list //no memory leakNote:The first assignment attached below has some problems, so please first fix them before doing the homework 3 based on the comments below:~*~==============================================~*~~Improved displayList() The header does not match with the printed table-3Points~*~==============================================~*~~Define a constructor for the Mountain class too, to make the MountainList class constructor simpler.MountainList::MountainList(){ head = new ListNode; // head points to the sentinel node head->mount.set_elevation(); head->mount.set_name(); head->mount.set_range(); head->mount.set_state(); head->next = NULL; count = 0;}// See belowMountainList::MountainList(){ head = new ListNode; head->next = NULL; count = 0;}Mountain::Mountain() { elevation = 0; name = ”; range = ”; state = ”;}-1Point~*~=======================================~*~~SEARCH: Achieving a Better Solution // See Chapter 1- Cohesive modules perform single well-defined tasks- Coupling – measure of dependence among modules – Loosely coupled modules desiredCohesion: keep one task per function: search and nothing else.No printing: all cout statements should be removed andthe header of the function should be updated// See below bool searchList(string, Mountain &) const;// In search manager1. call search2. if not found, print a message, otherwise print related data-2Points~*~==============================================~*~~SEARCHThe list is sorted… search should not go through the entire list if target is not found. For instance: list: 10 20 30 40 50 60 70 80 90target: 25stop searching at 30!-2Points~*~==============================================~*~~DELETEWhen searching for the node to be deleted from the listdo not go through the entire list if target is not found. For instance: list: 10 20 30 40 50 60 70 80 90target: 25stop searching at 30!-2Points~*~==============================================~*~~1. Download the two files attached: ‘FirstAssignmet.zip’ and ‘_22C_Hw3.pdf’2. Fix issues on the FirstAssignment based on the comments that I wrote above.3. Read CAREFULLY _22C_Hw3.pdf, and start working on homework 3.4. Before submit here, all requirements must meet as in the PDF and the comments, so please check again thoroughly.5. Submit within the given time. (Very Important)

Our Prices Start at $11.99. As A First Time Client, You Are Eligible For 15% Discount This Month!

Get The Answer Here
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *