Arrays
Arrays store multiple values of the same type. Learn to declare, access, and iterate over arrays.
Lessons
1. Intro
The Goal
2. What is an Array?
Indexed containers
3. Why Use Arrays?
Benefits of using arrays
4. Declaring Arrays
How to declare an array
5. Array Size
Understanding fixed sizing
6. Quiz: Array Basics
Test understanding
7. Accessing Elements
Reading and writing values
8. Zero-Based Indexing
Why arrays start at index 0
9. Quiz: Zero-based indexing
Zero-based indexing
10. Out of Bounds Access
Invalid index dangers
11. Quiz: Array Indexing
Test understanding
12. Initializing Arrays
Providing initial values
13. Partial Initialization
When you provide fewer values
14. Uniform Initialization
C++11 brace initialization
15. Quiz: Initialization
Test understanding
16. Iterating with for Loop
Visiting each element
17. Challenge: Array Sum
Traverse and accumulate
18. The Array-Loop Pattern
Standard iteration structure
19. Finding the Size
Calculate array length
20. Quiz: Iteration
Test understanding
21. Modifying Elements
Updating array contents
22. Common Array Operations
Processing all elements
23. Challenge: Find Maximum
Search through array
24. Finding Minimum
Locating the smallest element
25. Finding Maximum
Locating the largest element
26. Quiz: Collection basics
Collection basics
27. Counting Elements
How many meet a condition
28. Quiz: Array Operations
Test understanding
29. Passing Arrays to Functions
How arrays are passed
30. Array Decay
Why sizeof fails in functions
31. Passing Size Separately
Why you need a size parameter
32. Quiz: Functions with Arrays
Test understanding
33. Multidimensional Arrays
Arrays of arrays
34. 2D Array Syntax
Declaring and initializing
35. Nested Loops for 2D
Iterating over all elements
36. Problem - Reverse Array
Reversing order of elements
37. Problem - Find Duplicates
Detecting repeated elements
38. Problem - Stones on Table
Counting adjacent same colors
39. Stones - The Idea
Adjacent comparison pattern
40. Stones - Algorithm
Traversal approach
41. Quiz: Collection basics
Collection basics
42. Stones - Implementation
Working solution
43. Lessons from Stones
What we learned
44. Problem - George & Rooms
Filtering with conditions
45. George - The Idea
Difference calculation
46. George - Algorithm
Count-as-you-go approach
47. Quiz: Collection basics
Collection basics
48. George - Implementation
Working solution
49. Lessons from George
What we learned
50. Section Recap
What we learned