AP Computer Science A · Lesson 4.10 · Unit 4 · CED topic 4.10

ArrayList algorithms

Name:   Date:  

1 Why this lesson matters

Read the opening paragraph and the "Required content" box on the lesson page. In your own words, explain each objective below.

10.A. Develop code for standard and original algorithms for a particular context or specification that involve ArrayList objects and determine the result of these algorithms.

2 The same algorithms with get and size

Read this section. In your own words, summarize the main idea.

3 Comparing objects: use equals

Read this section. In your own words, summarize the main idea.

4 Algorithms that build a new list

Read this section. In your own words, summarize the main idea.

5 Inserting and removing in place

Read this section. In your own words, summarize the main idea.

6 Worked example

Read the "Worked example" box. Then, without looking back, try writing your own answer below.

Return the index of the largest element, or -1 if the list is empty.

7 Exam focus: avoid this mistake

Read the "Exam focus" box, then restate it in your own words.

8 Sum it up

In two or three sentences, explain this lesson's main idea to someone who has not read it.