Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 3 : For this problem you will have to review in detail ArrayList, your IOOP materiat that pertains to processing collections and specific features
Problem : For this problem you will have to review in detail ArrayList, your IOOP materiat 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 Document how many of the methods you found. How many of the approaches that you used for display could be used for displayReverse? positions etc if they exist found.
Develop your own test suite to thoroughly test your solution and include the sample runs in your submission. Below is info from ReviewFrame:
Special consideration: ArrayList collection processing using the following approaches:
direct index access in basic loop initial language design
iterators IteratorListlteratorJava and later
enhanced foreach loop Java and later
Java and laterspecific:
forEach method lambda expression
forEach method method reference
When to use each approach and their limitations Investigate in the context of efficiently implementing the following tasks on an ArrayList collection:
a 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
c 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.
Make sure to test your LabPDriver and place in LabPSampleruns.txt an extensive number of sample runs on various input data that you have designed.
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