Learning

~/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

0 notes

Arrays

Definition and Characteristics Linear Data Structure: An array is a collection of elements that are stored in contiguous memory locations. Indexed: …

0 notes

Strings

Strings are a fundamental data structure. They are particularly important in areas such as text processing, parsing, and algorithm design. …

0 notes

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 …

0 notes

Stacks

Stacks are an essential data structure in computer science, known for their Last-In-First-Out (LIFO) characteristic. They are used in various …

0 notes

Queues

Queues are a fundamental data structure used extensively in programming for managing data in a particular order. The order is typically …

0 notes

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 …

0 notes

Heaps

Heaps are a specialized tree-based data structure that satisfy heap properties, making them particularly useful for priority queue implementations and …

0 notes

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 …

0 notes

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 …

0 notes

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 StructureAccessFeaturesUse Cases
ArraysO(1)Fixed size, contiguous memoryFast access, known size
Linked ListsO(n)Dynamic sizeFrequent insertions/deletions
StringsO(1)Immutable (often)Text manipulation
StacksO(1) push/popLIFOUndo, recursion, DFS
QueuesO(1) enqueue/dequeueFIFOBFS, buffering
TreesO(log n) BSTHierarchicalSorted data, hierarchies
HeapsO(1) find min/maxComplete binary treePriority queues
GraphsO(V) or O(V²)Nodes + edgesNetworks, pathfinding
Hash TablesO(1) averageKey-valueFast lookups
Sets/MapsO(1) averageUnique elementsMembership, associations