How memory works

Algorithms and Data Structures From Zero to Hero

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

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

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 ➡️

--

--

Sometimes I write about technical topics and sometimes about what I feel like.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kemil Beltre

Sometimes I write about technical topics and sometimes about what I feel like.