data structure
A way of arranging data in memory, such as a list, dictionary, tree or graph, so that certain operations become cheap.
In more detail
The same values can be stored in many structures, and each makes some operations fast and others slow. A list keeps order and allows index access, while a dictionary answers "is this key here?" almost instantly. Picking a structure means picking the operations you will do most often and making those cheapest.
Related terms
- algorithm — A precise, finite list of steps that turns an input into the answer you want.
- abstract data type — A description of what a collection does, such as "last in, first out", without saying how it is stored.
- array — A sequence of same-sized slots stored one after another in a single block of memory, so any slot can be reached by its index directly.
- hash table — A data structure that stores key-value pairs in an array and uses a hash of each key to jump almost directly to its slot.
- min-heap — A heap in which every parent is less than or equal to its children, so the minimum is at the root; a max-heap reverses the order.
- FIFO — First in, first out: the ordering rule of a queue, where the oldest item is always the next to leave.
Taught in
- Why Complexity Matters In Production — Algorithms & Data Structures for Working Engineers
- Big O, Big Omega And Big Theta — Algorithms & Data Structures for Working Engineers
- Arrays: Contiguous Memory And Constant-Time Access — Algorithms & Data Structures for Working Engineers
- Choosing The Right Sequence — Algorithms & Data Structures for Working Engineers
- Searching With Hashes Versus Trees — Algorithms & Data Structures for Working Engineers
- Binary Trees And Their Traversals — Algorithms & Data Structures for Working Engineers
- Timers Phase: setTimeout, Min-Heap Scheduling & Drift — Node.js Internals & Backend Services