Notes
1D and 2D Arrays
Content of the notes (2)
Page 1
1D Arrays - Day One Notes
Slots start at 0.
Example: For 7 slots... 0 - 6.
Count on fingers. 0, 1, 2, 3, 4, 5, 6 = 7
Size x
Largest index is x-1
Example: 10 = 11 and 9 = 10
No Negatives
Array could create a log in system.
Page 2
2D Arrays
2 indexes instead of one.
[] []
First "box" = rows
Second "box" = columns
Use "for" loop for Outer which would be for rows.
2nd "for" loop for inner which would be for columns.
*For each loops
Module 6:
Linear Search - for loop with an if statement takes too long.
Binary Search - Splits search space in half.
Binary search = sort data first. Sorting is difficult and takes a long time.
Information
- Description
- Note on 1D and 2D Arrays, created by Gabrielle Keen on 08/03/2024.
- Created by
- Gabrielle Keen
- Views
- 4
- Rating