AP CSA FRQ Guide

2015 FRQ 3: SparseArray

Use a list of sparse entries to return a value at a row and column, then remove a column while shifting later columns.

Sparse 2D Data with ArrayList22 minute targetArrayList2D arraysobjectsmutation

Skills Tested

What this FRQ is really practicing

ArrayList2D arraysobjectsmutation

Treat these skills as the study checklist. If any tag feels shaky, review that topic before attempting the full written response.

Starter Approach

How to begin without copying a solution

  1. 1Find a matching SparseArrayEntry by row and column.
  2. 2Remove entries in the target column.
  3. 3Shift entries in columns after the removed column one position left.

Write a first attempt before revealing any solution outline. Most AP CSA FRQ progress comes from tracing your own code and finding the missing case.

Common Mistakes

Mistakes to watch for while writing

Returning the first entry in the row without checking the column.
Skipping entries after removal.
Forgetting to decrease numCols.
Shifting entries in columns before the removed column.

Self Check

Review questions before you submit

Traverses the entries list.

Only nonzero entries are stored.

Returns 0 when no matching entry is stored.

Missing entries represent zero.

Removes entries whose column equals the removed column.

Use remove carefully while traversing.

Shifts entries after the removed column left by one.

Entries with larger column indexes need a new column value.

Practice Links

Where to go next