9 - 2D Arrays

Imagine putting a bunch of bags or pencil cases into a box...
Those bags are arrays and the box is an array holding those bags!

What are we learning?

In this lesson we will:


Primitive vs. Abstract Data

Simple variables that can be stored in a single block of memory are called primitives. The typical primitive data types in a programming language are:

On the other hand, abstract data types require more processing power and memory. They are a combination of the primitive types.

Examples:

2D Arrays ๐Ÿ”ข

What if you had a garbage bag full of pencil cases?

Think of a single array like a shelf holding jars.
Now think of a bookshelf with many numbered shelves, each holding jars.ย 


๐Ÿค”ย  When is this useful?
All the time!ย  Think about games like Tetris, Pacman, or Block Blast.

1-Dimensional (1D) Array โฌ‡๏ธ

2-Dimensional (2D) Array โฌ‡๏ธ

2-Dimensional Array

Practice (classwork)

Let's practice 2D Arraysย  (GitHub)


๐Ÿฟ๏ธ