Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i have a project in c++ about how to use Recursion and classes together the top picture is the requirments and the bottom is the

i have a project in c++ about how to use Recursion and classes together the top picture is the requirments and the bottom is the output thank you for all your help

image text in transcribed

image text in transcribed

Assignment 3 - Recursion Using the linked list methodology we discussed in class do the following with singly linked lists. Make sure to include comments. The object of this assignment is that no matter what order you insert students(each with id and name) into the linked list, the list will be maintained in memory in ASCENDING ORDER with the head reference referencing the lowest order member student of the list(in this case use lexicographic order). 1. Insert the following data into a singly linked list (in the order shown below, with the item numbered 1 being the first insert and so on): 1. id=1 name=Max 2. id=2 name=John 3. id=3 name=Susan 4. id=4 name=Ben 5. id=5 name=Nancy Make sure that the list is maintained in ASCENDING ORDER in memory as referenced above. This means when the inserts are done, the list should hold the following: head-> (4,Ben) -> (2,John) -> (1, Max) -> (5,Nancy) -> (3, Susan) -> null 2. Print out the list using a ForwardList method which you have supplied for your list class. Print only the student names in the ascending order. Use recursion! head -> Ben-> John-> Max -> Nancy -> Susan -> null 3. Print out the list using a ReverseList method which you have supplied for your list class. Print only the student names in the descending order. Use recursion! null -> Susan -> Nancy -> Max -> John-> Ben-> head 0:5. C:\Windows\system32\cmd.exe Enter the student id: 1 Enter student name: Max Do you want to enter more student info? yes Enter the student id: 2 Enter student name: John Do you want to enter more student info? yes Enter the student id: 3 Enter student name: Susan Do you want to enter more student info? yes Enter the student id: 4 Enter student name: Ben Do you want to enter more student info? no Forward list: head -> Ben -> John -> Max -> Susan -> tail Reverse list: tail -> Susan -> Max -> John -> Ben -> head Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

More Books

Students also viewed these Databases questions