How memory works

Algorithms and Data Structures From Zero to Hero

Kemil Beltre
2 min readSep 21, 2022

Imagine you go to a show and need to check your things. A chest of drawers is available.

A set of drawers

Each drawer can hold one element. You want to store two things, so you ask for two drawer.

Two single drawers

And you’re ready for the show! This is basically how your computer’s memory works. Your computer looks like a giant set of drawers, and each drawer has an address.

Memory chip representation

A memory chip is a very simple circuit it is comprised of a very large typically very large number of certain units which we’re going to call “addressable units”

This addressable units have certain number of bits inside and is where the information is stored.

Why do we call this units addressable? We call this is because each of them have an address witch start from zero to size — 1.

Each time you want to store an item in memory, you ask the computer for some space, and it gives you an address where you can store your item.

Next

If you want to store multiple items, there are two basic ways to do so: arrays and list. I’ll talk about arrays and list next, as well as the pros and cons of each. There isn’t one right way to store items for every use case, so it’s important to know the differences.

⬅️ Data Structures | Table of content | Arrays and Linked Lists ➡️

--

--

No responses yet