Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 9 : For this problem you will have to review in detail ArrayList, your IOOP material that pertains to processing collections and specific features
Problem: For this problem you will have to review in detail ArrayList, your IOOP material that pertains to processing collections and specific features only available starting with Java Write a program that keeps track of a collection of individual characters. Use an ArrayList collection as the ONLY datafield of your class. Call the datafield data. Add the following functionality: a method called add that allows the addition of one new item character at the end of the collection for every possible different approach of processing an ArrayList collection design methods called displayNameOfProcessingMethod that display the content of the collection beginning with the first item and ending with the last item. You should have quite a few display methods! Document them and include a writeup with the number of methods found. Make sure to replace NameOfProcessing Method in the method name with the appropriate descriptive name for the approach used. For every possible way that you can apply that does not require the use of additional storage, design methods called displayReverseNameOfProcessingMethod that display the content of the collection beginning with the last item and ending with the first item. Document how many of the methods you found. How many of the approaches that you used for display could be used for display Reverse? For every possible way that you can apply that does not require the use of additional storage, design methods called testIfPalindromeNameOfProcessing Method that returns true if the collection is a palindrome, false otherwise. Document how many methods you found. Develop your own test suite to thoroughly test your solution and include the sample runs in your submission. Below is info from ReviewFrame: consider Special consideration: ArrayList collection processing using the following approaches: direct index access in basic loop initial language design iterators IteratorListIteratorJava and later enhanced foreach loop Java and later Java and laterspecific: forEach method lambda expression forEach method method reference a When to use each approach and their limitations Investigate in the context of efficiently implementing the following tasks on an ArrayList collection: displaying the content of the collection starting with the first item and ending with the last item b displaying the content of the collection starting with the last item and ending with the first item checking if the content of the collection is a palindrome Important efficiency considerations: no additional storage for the collection, no repeated passes through the collection.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started