Unit 6 · 5 lessons
Arrays
One name for many values: declaring arrays, walking them with loops, the standard algorithms every exam asks for, and two-dimensional grids.
- 56 practice questions
- 46 flashcards
- 3 interactive lessons
Lessons
- 1Declaring and Using ArraysWhy a single name for many values changes what a program can do — and the indexing rules that come with it.11 questions
- 2Traversing Arrays and the Standard AlgorithmsThe two ways to walk an array, and the handful of algorithms — sum, average, max, count, search, reverse — that every array question is built from.12 questions
- 3Sorting and Binary SearchTwo classic sorts traced pass by pass, why a method can sort the caller's array, and how sorted data lets binary search find anything in a handful of steps.Interactive11 questions
- 4Strings as Sequences of CharactersA String is an indexed sequence of characters, so the array skills you already have — indexing, traversal, searching — carry straight over to text, with a handful of String methods doing the heavy lifting.Interactive11 questions
- 5Two-Dimensional ArraysRows and columns: declaring a grid, reaching a cell with two indexes, and walking the whole thing with nested loops.Interactive11 questions