6.4

Array Algorithms

AP Computer Science A

1. Sum and Average

2. Finding Maximum and Minimum

Trace for max

3. Linear Search

4. Counting Matches

5. Checking If All / Any Meet a Condition

Check if ALL elements pass

Check if ANY element passes

6. Shifting Elements

Shift left (remove first)

Shift right (remove last)

7. Reversing an Array

Trace

8. Removing an Element at Index

9. Inserting an Element

10. Duplicate detection

Algorithm summary table

Complete example: Frequency counter

AP Exam Tips

Common Mistakes

Key Vocabulary