1/3
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
There are standard ArrayList algorithms that utilize traversals to:
Insert elementsDelete elements
Determine the minimum or maximum value
Compute a sum, average, or mode of elements
Search for a particular element in the array
Determine if at least one element has a particular property
Determine if all elements have a particular property
Access all consecutive pairs of elements
Determine the presence or absence of duplicate elements
Determine the number of elements meeting specific criteria
Shift or rotate elements left or right
Reverse the order of the elements
for (Type obj : list) { if (obj ....) ... } for(int i=0; i < list.size(); i++) { if (list.get(i) ....) ... }
If you use add or remove inside a loop that traverses an ArrayList, you may get unexpected results because the size of the ArrayList has changed!
-