Objective
The objective of this Lab is to explore creating and using an ordered linked list.
Task
1. Create an ordered double-linked list class.
See Prev – Same as SeeNext except in the other direction.
See At – Finds an item at a location in the list (int passed in from user), and returns the item without removing it. If the location passed by the user is past the end of the list, this will throw an error. This will set the location used by SeeNext to point at the item after the item returned.
Reset – resets the location that the SeeNext function uses to point at the first item in the list.
Destructor – make sure you remove all items to avoid memory leaks
All items passed to or from the class should be done so via a pointer rather than by value.
Make sure you don’t have any memory leaks.
2. Create a class to be used as the item stored in the list. This class will be a part. It should have the following members at a minimum.
1. Private
2. Public
3. Create a test program that has a menu allowing you to test each of the functions in your linked last class (Task 1).
4. Create a visualization of your list using ASCII art.
Modify your linked list class to add a new public method to display the list.
This method should write directly to the screen.
This method should walk through the list and display every item in the list on the screen. The format of the output is up to you.
To display the contents of the item in the list, it should call the display member of the item (created in step 1 of this task).
This method should reuse members of the class as much as possible.
This method should not change the results of SeeNext method meaning it should not have a different value for the internal variable used by SeeNext after this method completes.
Modify your test program from task 3 to include an option that calls this new method.
Test your modifications. Include in your lab report a screen shot showing the results of this new method with at least 4 items in your list.
BEN02 Planning and Presenting a Micro-Enterprise Idea BTEC Level 1/2
Read MoreBTEC Unit 35: Engineering Services Delivery Plan for Sector-Specific Organizations | HND Level 5 Assignment 2
Read MoreTQUK Level 3 Administering Medication and Monitoring Effects in Adult Care Assignment
Read MoreUnit 10: 3D Modelling and Assembly Drawing for Vice – Engineering Design Portfolio BTEC Level 3
Read MoreWhy is it important that you correlate the appropriate information of the patient when they arrive for their appointment?
Read MoreNCFE Level 3 Roles and Responsibilities in Health And Social Care
Read MoreMP3395 Turbocharger Performance Evaluation and System Analysis CW2 Assessment, AY2024-25
Read MoreKey Research Policies and Funding Models at University of Strathclyde
Read MoreCIPD Level 5 Associate Diploma Key Assessment Questions
Read MoreLaw Assignment Questions Critical Legal Analysis & Solutions
Read More