Estructuras de Datos y Algoritmos
Big-O, ordenamientos (bubble, selección, inserción, merge, quick), búsqueda binaria, listas enlazadas, pilas, colas, tablas hash, árboles de búsqueda y heaps — en Java real que compila y se ejecuta en el IDE Arena, con una pestaña Visualize que anima cada algoritmo paso a paso.
- Paso 1
Big-O notation
Measure growth, not seconds
Empezar lección - Paso 2
Arrays & memory
Index O(1), search O(n), insert O(n)
Empezar lección - Paso 3
Bubble sort
O(n²) time · O(1) space · stable
Empezar lección - Paso 4
Selection sort
O(n²) time · O(1) space · ~n swaps
Empezar lección - Paso 5
Insertion sort
O(n²) worst · O(n) nearly-sorted · stable
Empezar lección - Paso 6
Merge sort
O(n log n) time · O(n) space · stable
Empezar lección - Paso 7
Quick sort
O(n log n) avg · O(n²) worst · in-place
Empezar lección - Paso 8
Binary search
O(log n) — requires a sorted array
Empezar lección - Paso 9
Linked lists
Insert/remove at head O(1) · index O(n)
Empezar lección - Paso 10
Stacks & queues
Push/pop/enqueue/dequeue O(1)
Empezar lección - Paso 11
Hash tables
Average O(1) insert / lookup / delete
Empezar lección - Paso 12
Binary search trees
O(log n) balanced · O(n) worst (skewed)
Empezar lección - Paso 13
Heaps & priority queues
Peek O(1) · insert/remove O(log n)
Empezar lección - Paso 14
Recursion & the call stack
One frame per call · O(depth) memory
Empezar lección - Paso 15
Two pointers
O(n) time · O(1) space
Empezar lección - Paso 16
Sliding window
O(n) time · O(1) or O(k) space
Empezar lección - Paso 17
Prefix sums & difference arrays
O(n) build · O(1) per query
Empezar lección - Paso 18
Backtracking
Exponential by nature · prune to survive
Empezar lección - Paso 19
Graphs & how to store them
Adjacency list O(V+E) space · matrix O(V²)
Empezar lección - Paso 20
Breadth-first search
O(V + E) · shortest path when edges are unweighted
Empezar lección - Paso 21
Depth-first search
O(V + E) · components, cycles, ordering
Empezar lección - Paso 22
Topological sort
O(V + E) · order a DAG by dependency
Empezar lección - Paso 23
Union-Find (disjoint sets)
Near O(1) amortised per operation
Empezar lección - Paso 24
Dynamic programming — memo to table
Exponential to polynomial by remembering
Empezar lección - Paso 25
DP II — knapsack & grids
O(n·W) time · O(W) space compressed
Empezar lección - Paso 26
Greedy algorithms
Usually O(n log n) — the sort dominates
Empezar lección - Paso 27
Tries (prefix trees)
O(L) per word · shares prefixes
Empezar lección - Paso 28
Bit manipulation
O(1) per operation · O(32) per int
Empezar lección - Paso 29
Sorting without comparisons
O(n + k) counting · O(d(n + b)) radix
Empezar lección - Paso 30
String matching — KMP
O(n + m) · never re-reads the text
Empezar lección - Paso 31
Comparators & sorting objects
O(n log n) comparisons · TimSort is stable, dual-pivot quicksort is not
Empezar lección - Paso 32
Matrices & grids
O(rows × cols) per traversal · in-place rotate is O(1) extra
Empezar lección - Paso 33
Monotonic stacks
O(n) — every index is pushed once and popped at most once
Empezar lección - Paso 34
Intervals
O(n log n) — the sort dominates, every sweep after it is one pass
Empezar lección - Paso 35
Binary search on the answer
O(n log(hi - lo)) — one O(n) feasibility check per halving
Empezar lección - Paso 36
Quickselect
O(n) average · O(n^2) worst · O(1) extra space
Empezar lección - Paso 37
Dijkstra's shortest path
O((V+E) log V) with a binary heap
Empezar lección - Paso 38
Minimum spanning trees
Kruskal O(E log E) · Prim O((V+E) log V)
Empezar lección - Paso 39
DP on strings
O(m·n) time · O(min(m,n)) space once the table is rolled
Empezar lección - Paso 40
Fenwick trees (BIT)
Update and prefix query both O(log n) · O(n) memory
Empezar lección - Paso 41
Number theory essentials
gcd O(log min(a,b)) · sieve O(n log log n) · modular power O(log e)
Empezar lección - Paso 42
Designing an LRU cache
O(1) get and put · O(capacity) memory
Empezar lección - Paso 43
Kadane's algorithm — maximum subarray
O(n) time · O(1) space · one comparison per element
Empezar lección - Paso 44
Heap sort — sorting in place with a heap
O(n log n) worst case · O(1) extra space · build is O(n) · not stable
Empezar lección - Paso 45
Floyd's cycle detection — tortoise and hare
O(n) time · O(1) space · finds the cycle, its entrance and its length
Empezar lección - Paso 46
Rabin–Karp — rolling hashes
O(n + m) expected · O(n·m) worst case · O(1) extra space
Empezar lección - Paso 47
Palindromes — expanding around centres
O(n²) time, O(1) space — 2n−1 centres, each expanded once
Empezar lección - Paso 48
Bellman–Ford — shortest paths with negative edges
O(V·E) time · O(V) space · negative edges allowed, negative cycles detected
Empezar lección - Paso 49
Floyd–Warshall — every pair at once
O(V³) time · O(V²) space · negative edges allowed
Empezar lección - Paso 50
Self-balancing trees — rotations
O(log n) insert, delete and search — guaranteed, not hoped for
Empezar lección - Paso 51
Segment trees — range queries that survive updates
Build O(n) · query and update O(log n) · one int[] of 4n
Empezar lección - Paso 52
Huffman coding — the shortest possible codes
Build O(n log n) in the alphabet · encode O(bits out) · within 1 bit of entropy
Empezar lección - Paso 53
Strongly connected components — Kosaraju
O(V + E) time · two DFS passes over a graph and its transpose
Empezar lección - Paso 54
Shuffling and sampling — Fisher–Yates and reservoir
Shuffle O(n) time · O(1) space · reservoir O(n) time · O(k) space, one pass
Empezar lección - Paso 55
Choosing the right structure
The skill every other lesson feeds
Empezar lección