File intlist.java contains definitions for a linked list of integers

CSE 1302 Lab 9

Linked Lists – do Part A and Part B

           

Add the following cases:

            case 5: list.length()

            case 6 : SOP ( list);

            case 7: list.removeLast()

            case 8: list.replace(oldVal,newVal)

            case 9: list.printRec()

            case 10: list.printRecBkw()

 

Turn in final source and output.  Use the following data:

            First: try each of the methods you wrote with an empty list.

            Second: add 1 element to the list and try each of your methods again.

            Then using the following codes:

                        1: add 66 and 32 to front

                        2: add 55 and 24 to end

                        9: print list (with recursive method)

                        3: remove first

                        4: print list

                        10: print list backwards (with recursive method)

                        5: print length of list

                        6: print the list again with case 6 to test toString() method

                        7: remove last

                        1: add 66 again

                        4: print list

                        8: replace 66 with 999

                        4: print list

                        0: quit

 

Part A. A Linked List of Integers

File IntList.java contains definitions for a linked list of integers. The class contains an inner class IntNode that holds information for a single node in the list (a node has a value and a reference to the next node) and the following IntList methods:

public IntList()—constructor; creates an empty list of integers

public void addToFront(int val)—takes an integer and puts it on the front of the list

public void addToEnd(int val)—takes an integer and puts it on the end of the list

public void removeFirst()—removes the first value from the list

public void print()—prints the elements in the list from first to last

 

File IntListTest.java contains a driver that allows you to experiment with these methods. Save both of these files to your directory, compile and run IntListTest, and play around with it to see how it works. Then add the following methods to the IntList class. For each, add an option to the driver to test it.

 

1.         public int length()—returns the number of elements in the list

2.         public String toString()—returns a String containing the print value of the list.

3.         public void removeLast()—removes the last element of the list. If the list is empty, does nothing.

4.         public void replace(int oldVal, int newVal)—replaces all occurrences of oldVal in the list with newVal. Note that you can still use the old nodes; just replace the values stored in those nodes.

 

 

Calculate the price
Make an order in advance and get the best price
Pages (550 words)
$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Upload your instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with Australia Assessments
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
Testimonials
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
Management
support is great. I am grateful to you and your company. thank you very much.
Customer 454227, April 6th, 2020
Automotive
Excellent Keep it up
Customer 452441, April 26th, 2022
Beauty
Good job. Always limit quoted content even when instructed to use them.
Customer 452441, March 31st, 2022
Military
Good work.
Customer 456821, May 11th, 2022
Health Care
Met expectations. Thank you.
Customer 454755, June 30th, 2020
Human Resources Management (HRM)
Thank you for this excellent power point
Customer 453633, February 24th, 2020
Business and administrative studies
Good work.
Customer 458115, May 24th, 2022
IT
Well researched
Customer 463377, May 15th, 2023
English 101
Thank You!
Customer 454425, June 21st, 2020
Science
Good one.
Customer 453625, May 21st, 2022
Education
Thank you!
Customer 463875, April 29th, 2023
Philosophy
Thank you for helping me with such a hard and sad topic. I found it very hard to write and be partial and fair state of mind. In the paper you pointed out points that I had missed. Thank you again!
Customer 463465, January 9th, 2023
11,595
Customer reviews in total
96%
Current satisfaction rate
3 pages
Average paper length
37%
Customers referred by a friend
OUR GIFT TO YOU
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat