Question: 7.1: Task 1: Using C++: Create an ordered linked list class. Create a new project. You can name this whatever you like. Design and implement

7.1: Task 1: Using C++: Create an ordered linked list class.

Create a new project. You can name this whatever you like.

Design and implement an ordered linked list class as described in class. This class should be a template. The class should have the following methods fully implemented.

Constructor

SeeNext returns the item without removing it from the list at a given location in the list. The class will maintain the next location and will start at the first item in the list. When it gets to the last item in the list, it will return a null pointer after it gets past the last item. If the list is empty, this will throw an error. 2 calls to SeeNext will return the 2 items next to each other in the list unless SeeAt or Reset is called in between the 2 calls (or the first call returns the last item in the list).

SeeAt 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

All items passed to or from the class should be done so via a pointer rather than by value.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!