Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective: The goal of this assignment is to practice recursion Assignment: This assignment is an extension of the previous lab assignment. The assignment requires writing

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Objective: The goal of this assignment is to practice recursion Assignment: This assignment is an extension of the previous lab assignment. The assignment requires writing recursive methods for some linked list operations. The use of loops is strictly prohibited in this assignment. That is, you cannot use for, while, and do-while in the recursive methods you will write. The only time you can use a loop is when you initiate values for a linked list. Consider that you are given he following linked list node public class MyListofints i public int firstInt: public MyListofInts restofTheInts; public MyListfInts (int f) f firstint-f public MyListfInts (int f, MyListofInts r) firstint-f restofTheInts-r Clearly, this class can be used to create a linked list. Write an additional class named ListOperations that will contain the following methods. Notice that you have to write only a few additional new methods (marked in blue) to the previous Lab assignment (Lab 5) 1. Write a recursive method named printMyList (MyListofInts m) to print 2. Write a recursive method named sumOfMyList (MyListofInts m) that 3. Write a recursive method named maxOfMyList (MyListofInts m) that 4. Write a recursive method named lengthofMyList (MyListofInts m) 5. Write a recursive method named reverseMyList (MyListofInts m) to 6. New operation: all the integers in the linked list M. Notice that M is the head of the linked list. will sum up all the integers in the linked list M and return the summation value will return the largest number in a linked list. that will compute and return the length of a given linked list M. reverse a linked list. Return the head of the reversed linked list. Write a recursive method removeANumberFromMyList (MyListofInts m, int removee) to remove the first occurrence of a specific number

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

Describe the new structures for the HRM function. page 724

Answered: 1 week ago