Arrays, Lists & Matrices
The workhorse data structure of competitive programming: a row of numbered slots you can read, change and scan.
After this lesson you will be able to
- Explain indices, zero-based counting and what each array operation costs.
- Traverse, update, slice, copy and reverse arrays correctly in Python.
- Build and index a 2D matrix, and avoid the shared-row aliasing bug.
- Count frequencies of items with a dictionary.
- Recognise problems that are really about indices, in-place changes or counting.
Before you start. Python Basics, Lists & Tuples and Complexity are the foundation here; the topic assumes you can write a for loop.