~/victorpierre.dev $ ls learning/programming/data-structures/
Data Structures
Browse the notes, references, and topic maps collected under this part of the learning archive.
Topic map
Explore Data Structures
Arrays
Definition and Characteristics Linear Data Structure: An array is a collection of elements that are stored in contiguous memory locations. Indexed: ā¦
Strings
Strings are a fundamental data structure. They are particularly important in areas such as text processing, parsing, and algorithm design. ā¦
Linked Lists
Linked lists are a fundamental data structure that provide an alternative to arrays in storing sequences of elements. They are particularly useful in ā¦
Stacks
Stacks are an essential data structure in computer science, known for their Last-In-First-Out (LIFO) characteristic. They are used in various ā¦
Queues
Queues are a fundamental data structure used extensively in programming for managing data in a particular order. The order is typically ā¦
Trees
A tree is a hierarchical, dynamic data structure that consists of nodes, where each node contains a value and a list of references to other nodes (its ā¦
Heaps
Heaps are a specialized tree-based data structure that satisfy heap properties, making them particularly useful for priority queue implementations and ā¦
Graphs
Graphs are a collection of nodes and edges. They are used to represent networks and relationships between objects. Graphs are used to model real-world ā¦
Hash Tables
Hash tables are a data structure that stores key-value pairs. They are used to implement associative arrays, sets, and caches. A hash table uses a ā¦
Sets and Maps
Sets A set is a collection of distinct elements. It is used to store unique values. Sets are used to solve problems that involve finding unique ā¦
Data structures are a way of organizing and storing data so that they can be accessed and worked with efficiently. They define the relationship between the data, and the operations that can be performed on the data.
These notes are meant to be a quick reference for the most common data structures and their use cases.
Overview
Arrays
Arrays are the simplest and most widely used data structure. They store a collection of elements with O(1) access by index.
Strings
Strings are a collection of characters used to represent text. They are a special type of array, often immutable.
Linked Lists
Linked lists are a collection of nodes, where each node contains a value and a reference to the next node.
Stacks
Stacks follow LIFO (Last-In-First-Out) order. Elements are added and removed from the top.
Queues
Queues follow FIFO (First-In-First-Out) order. Elements are added to the back and removed from the front.
Trees
Trees are hierarchical structures where each node contains a value and references to its children.
Heaps
Heaps are complete binary trees that maintain a heap property, enabling efficient priority queue operations.
Graphs
Graphs are nodes with edges connecting them, used for modeling complex relationships.
Hash Tables
Hash tables store key-value pairs with O(1) average access time.
Sets and Maps
Collections of unique elements (Set) and key-value pairs (Map).
Cheatsheet
| Data Structure | Access | Features | Use Cases |
|---|---|---|---|
| Arrays | O(1) | Fixed size, contiguous memory | Fast access, known size |
| Linked Lists | O(n) | Dynamic size | Frequent insertions/deletions |
| Strings | O(1) | Immutable (often) | Text manipulation |
| Stacks | O(1) push/pop | LIFO | Undo, recursion, DFS |
| Queues | O(1) enqueue/dequeue | FIFO | BFS, buffering |
| Trees | O(log n) BST | Hierarchical | Sorted data, hierarchies |
| Heaps | O(1) find min/max | Complete binary tree | Priority queues |
| Graphs | O(V) or O(V²) | Nodes + edges | Networks, pathfinding |
| Hash Tables | O(1) average | Key-value | Fast lookups |
| Sets/Maps | O(1) average | Unique elements | Membership, associations |