Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Submssion: Submit everything together as one PDF file in Canvas. Due: Oct. 4th, by 11.59 PM Q1 - 20 pts) Consider the implementation of the

image text in transcribed

Submssion: Submit everything together as one PDF file in Canvas. Due: Oct. 4th, by 11.59 PM Q1 - 20 pts) Consider the implementation of the List ADT using Singly Linked List given to you for this question. Add a member function (to the List class) called recursivePrintForwardReverseOrders that prints the contents of the list in a recursive fashion in both the forward order and reverse order. For example, if the contents of the List are: 10-4812 ->9. the recursive member function should print the List as follows: 10 4 8 12 9 9 12 84 10 Note that both the forward and reverse orders should be printed through an invocation of the recursivePrint ForwardReverseOrders member function on the List object called from the main function. You are free to choose the parameter(s) that need to be passed to the recursivePrint ForwardReverseOrders function. But, you are not supposed to pass more than three parameter(s). A suggestion for the parameter to pass is given in the main function of the code posted for Question 1. To test your code (and take screenshot), create a List of at least 10 elements (with a maximum value of 100) and then call the recursivePrintForwardReverseOrders function on this List object by passing a pointer to the first node in the Linked List as an argument, as shown in the main function of the Singly Linked List code for Question 1 Linked List eode fo You need to submit the following as part of your answer for this question (G) the complete code for the Node class, List class (including the recursivePrintForwardReverseOrderst) function) and the main function. (ii) Snapshot of the execution of the code with at least 10 elements and maximum value of 100 Q2 - 15 pts) Consider the implementation of the Singly Linked List class (named: List) given to you for this question. Your rask is to add a member function called pairwiseSwap) to the Singly Linked List class such that it he code to swap the elements of an integerList (an Submssion: Submit everything together as one PDF file in Canvas. Due: Oct. 4th, by 11.59 PM Q1 - 20 pts) Consider the implementation of the List ADT using Singly Linked List given to you for this question. Add a member function (to the List class) called recursivePrintForwardReverseOrders that prints the contents of the list in a recursive fashion in both the forward order and reverse order. For example, if the contents of the List are: 10-4812 ->9. the recursive member function should print the List as follows: 10 4 8 12 9 9 12 84 10 Note that both the forward and reverse orders should be printed through an invocation of the recursivePrint ForwardReverseOrders member function on the List object called from the main function. You are free to choose the parameter(s) that need to be passed to the recursivePrint ForwardReverseOrders function. But, you are not supposed to pass more than three parameter(s). A suggestion for the parameter to pass is given in the main function of the code posted for Question 1. To test your code (and take screenshot), create a List of at least 10 elements (with a maximum value of 100) and then call the recursivePrintForwardReverseOrders function on this List object by passing a pointer to the first node in the Linked List as an argument, as shown in the main function of the Singly Linked List code for Question 1 Linked List eode fo You need to submit the following as part of your answer for this question (G) the complete code for the Node class, List class (including the recursivePrintForwardReverseOrderst) function) and the main function. (ii) Snapshot of the execution of the code with at least 10 elements and maximum value of 100 Q2 - 15 pts) Consider the implementation of the Singly Linked List class (named: List) given to you for this question. Your rask is to add a member function called pairwiseSwap) to the Singly Linked List class such that it he code to swap the elements of an integerList (an

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

Oracle 12c SQL

Authors: Joan Casteel

3rd edition

1305251032, 978-1305251038

More Books

Students also viewed these Databases questions

Question

What would the person you most admire do?

Answered: 1 week ago

Question

What method(s) will I use to communicate and celebrate?

Answered: 1 week ago