What is the complexity of searching an ArrayList?
Search Results
Searching for: arraylist
Individual Exercises
Which of the following is a correct instantiation of an array list collection?
The local library needs help keeping track of overdue books. Currently, the library has a record of each book checked out but wishes to...
Write a method that reverses the contents of any given string array, then return the reversed conents as an arraylist. If the given array...
The Student Chapter for the Association for Computing Machinery (ACM) requested your help. Throughout the semester, attendance for the...
What interface does the Array list implement?
Do array lists automatically enlarge (or shrink) based on the size of the collection?
What is most important to know when attempting to retrieve an element from an array list?
When the index is known, what is the time complexity for accessing an element in an array list?
Write an algorithm that takes an ArrayList and uses a recursive binary search to return both the index of a given String, or -1 if the...
This method takes an ArrayList of Strings as a parameter and returns the longest String in the list. If the list is empty, it should...
This method takes an ArrayList of Strings as a parameter and returns the length of the longest String in the list. If the list is empty,...
This method takes an ArrayList of integers as a parameter and does not return anything. The method will expand the list with a mirrored...
This method takes an ArrayList of integers as a parameter and does not return anything. The method will remove all of the odd elements in...
This method takes an ArrayList of integers as a parameter and does not return anything. The method will repeat each odd element in the...
Write a method that reverses the contents of the given string array contents
returning an ArrayList<String>
with the resutts. If...
Complete the function countStrLongerThan()
so that it returns the count of Strings in the ArrayList<String> names
that are longer...
Complete the function removeStrLongerThan()
so that it removes from strings in the ArrayList<String> names
that are longer than ...
For this question, declare and instantiate a new ArrayList (you can name the variable whatever you'd like).
Then, return that ArrayList
The method below takes in a Pixel object called p
as a parameter. In the body of the method below, declare and instantiate an ArrayList...
The method below takes in two parameters: a Pixel object called p
and an ArrayList called arr
. For this method, if the ArrayList has less...
The method below takes in an ArrayList called arr, and returns that ArrayList. Before the return statement, remove the first item in the...
For this question you will be using Pixel objects and one Picture object, as described in Reading Activity 06. The following method uses...
For this question you will be using Pixel objects and one Picture object, as described in Reading Activity 06. In the body of this...
For this question you will be using Pixel objects and one Picture object, as described in Reading Activity 06. In the method below write...