seegongsik
Saved words
Data

Information has a shape too

When you store things, what do you put them in? Sometimes a long line, sometimes a table split into cells, sometimes a branching shape. Even the same things become easy or hard to grab depending on where you put them. Information is the same. There is a shape to holding information, and we'll call that shape a container.

01

Same information, different shapes

Say you have the names of five friends.
How will you hold these names?
You could stand them in one long line,
or put them in a table split into cells,
or split them like branches from top to bottom
and hang them there.
The contents are the same.
But the shape they're held in is totally different.
That shape is what we call a container.

Mina
-
Theo
-
Ravi
-
Lia
-
Sora
Held in one line, one after another. The order shows at a glance.
Tap a shape to switch. The names inside stay the same.

Hold the same names as a line, a table, then a branch. The contents stay the same, the shape changes.

Even as the shape changed,
the names inside stayed the same.
But each shape
probably felt a little different.
A line shows the order at a glance,
a table is good for pointing at one cell,
a branch shows what's above and below.
So then,
which shape should we pick?

02

A container that fits the job

You shouldn't use just any container.
First picture the job you want to do.
If you want to go through things in order,
holding them as a line is good.
If you want to find something by name right away,
holding them as a table is good.
If you want to tell who is under whom,
a branch fits well.
Even for the same information, by purpose
the fitting container changes.

line
table
branch
Tap the job you want.

Tap the job you want. The container that fits it best lights up and tells you why.

Each time you tapped a different job,
the glowing container changed.
There isn't one container that's the right answer;
what you want to do decides the answer.
If order matters, a line;
if fast finding matters, a table.
But there's one more thing.
A single container can't do every job
equally well.

03

Some fast, some slow

Say you picked one container.
That container does some actions very fast
and some actions quite slowly.
Think of a line.
Going through it from the front is fast.
But to squeeze a new name
into the middle of the line,
you have to push everything after it, so it's slow.
Each container has things it's good at
and things it's clumsy at.

Pick a container first
Pick a container, then tap an action to see fast or slow.

Pick a container, then tap an action. In the same container, fast and slow actions split apart.

Even inside the same container,
fast tasks in green and
slow tasks in red split apart.
So when you pick a container,
look at what you'll do most often.
A container where your frequent task is fast,
that's the good choice.
Even for the same data, how you hold it
decides whether it's fast or slow.

04

A taste of the main containers

Let's take a small taste, just the names,
of containers we'll meet often.
The one that holds things in order like a line is an array,
the one that holds pairs with a name tag is a dictionary,
there's one you add to and take from at one end only,
one where, lined up, the first in is the first out,
and a branching shape that splits top to bottom.
For now just remember the names and the feel.
The details come one by one in later lessons.

array
Holds things in order like a line and grabs one by number.
fitsgo through in order and find by number
Tap a container to flip through. Details come in later lessons.

Tap through the main containers. Each one shows a one-line intro and what it fits.

It's fine if the names feel a bit new.
That there are many kinds of containers,
that each one fits certain jobs,
just holding onto that is enough for now.
Now that we've had a taste,
let's go back to the start
and gather what we learned into one line.

05

Let's wrap up

Gathered on one line, it is this.
Holding information has a shape too, a container.
Even the same data can take a different holding shape,
like a line, a table, or a branch.
You pick a container to fit the job.
A container is fast at some tasks and slow at others.
So picking well makes a program faster.
Even for the same data, how you hold it
decides the speed; that's the heart of it.

Tap the key points in order to review.

Tap the key points in order to review. (information has a shape -> a container that fits the job -> fast and slow tasks -> a taste of containers)

Now you know information has a shape too.
You've gained a bit of an eye for picking containers.
In the next lesson we'll look closely
at the most basic container,
the array that holds things in order like a line.
Let's uncover together its fast secret
of numbering each spot and pulling one out.

In one lineHolding information has a shape too, and we call that shape a container. Even the same data takes a different shape depending on whether you hold it as a line, a table, or a branch. You don't grab just any container; you pick the one that fits the job. To go through things in order, a line is good; to find something by name fast, a table is good. And no single container does everything equally well. Some actions are fast and some are slow. So picking the right container is the start of a fast program. In the next lessons we'll meet the main containers one by one.
Data
Was this helpful? Support seegongsik