Series 2: Arrays & Algorithms

Fixed-size collections, traversal patterns, searching, and sorting — your first real data structures.

Lessons

2.1: Array Basics

~20 min · Week 6 · Prereq: Lessons 1.4, 1.5

Declaration, initialization, indexing, traversal with for and for-each, default values, and reference semantics. Python lists grow dynamically — Java arrays are fixed-size.


2.2: Searching Arrays

~18 min · Week 6 · Prereq: Lesson 2.1

Linear search (O(n)) and binary search (O(log n)). Pass-by-pass tracing, when to use each, and why sorted data enables dramatically faster searches.


2.3: Selection Sort

~18 min · Week 6 · Prereq: Lesson 2.1

Find the minimum, swap it to the front, repeat. Pass-by-pass tracing, the three-step swap, nested loops, and O(n²) performance.


2.4: Arrays and Methods

~20 min · Week 6 · Prereq: Lessons 2.1, 1.5

Passing arrays to methods, reference semantics with memory diagrams, Arrays.toString/sort/copyOf, and a brief intro to ArrayList.


Previous series: ← Series 1: Java Foundations

Next series: Series 3: File I/O →