Skip to content
Marlbridge

AP® Computer Science A · Unit 4 · Topic 4.9

ArrayList Traversals: Checklist (Computer Science A 4.9)

A self-check for ArrayList traversals: writing index and enhanced for loops, avoiding skipped elements when deleting, and predicting index and modification exceptions.

Tick each line when you can do it without looking at the guide. Each line names where it is taught and tested. Revisit the study guide for anything you cannot yet do.

Understanding

  • ☐ I can define a traversal and name the three loop forms for an ArrayList (study guide: What a traversal is; The three loop forms).
  • ☐ I can explain why the index condition is i < size() and not i <= size() (study guide: The three loop forms; practice: Question 2).
  • ☐ I can explain why removing in a forward loop skips an element (study guide: Changing the size during a traversal; practice: Question 1).
  • ☐ I can explain why assigning to an enhanced for variable does not change the list (practice: Question 5).

Skills

  • ☐ I can write an indexed loop that reads or replaces elements with get and set (study guide: Reading and replacing during a traversal).
  • ☐ I can write a backward loop that removes matching elements (study guide: Worked example 1; practice: Questions 4 and 9).
  • ☐ I can write a while loop that holds the index after a removal (study guide: Worked example 1; practice: Question 7).
  • ☐ I can build a String or a total while traversing in forward or reverse order (study guide: Worked example 2; practice: Question 6).

Reasoning

  • ☐ I can trace a traversal that removes elements and write the list after each pass (study guide: Worked example 1; practice: Question 8).
  • ☐ I can predict ConcurrentModificationException for a removal inside an enhanced for loop (practice: Question 3).
  • ☐ I can explain why a deletion bug may pass a test with non-adjacent matches (study guide: Worked example 1).
  • ☐ I can choose the right loop form for a task and justify it (study guide: The three loop forms; practice: Question 10).

Next: Topic 4.10 implementing ArrayList algorithms.

AP® and Advanced Placement® are trademarks registered by the College Board, which is not affiliated with, and does not endorse, this website. Marlbridge is an independent tuition provider. It is not an authorized AP course provider, an AP school or an exam centre, and these resources are not official College Board materials. Reading them or doing simulations does not meet the laboratory requirement of an AP science course.