🧠 Complete Algorithm Suite

Essential Algorithms for Python, Angular & Data Engineering. Learn with real code, visual breakdowns, practical use cases, and interview tips!

Note on Angular/TypeScript: While Python examples are shown for backend logic, these algorithmic concepts are fundamental. In Angular, you'd implement similar logic in TypeScript for frontend tasks like data manipulation, filtering, sorting, or custom component behavior. The principles remain the same!

πŸ“Š Sorting Algorithms

Bubble Sort

Compares adjacent elements and swaps.

Compares: 0

Selection Sort

Finds minimum, places at start.

Compares: 0

Insertion Sort

Inserts element in sorted position.

Compares: 0

Quick Sort

Divides around a pivot element.

Partitions: 0

Merge Sort

Divides and merges sorted subarrays.

Merges: 0

Heap Sort

Builds heap, then extracts max.

Ops: 0

🌳 Tree Algorithms

Binary Search Tree (BST)

Search, insert, delete operations.

50
30
70
20
40
60
80

Tree Traversals

Visiting tree nodes systematically.

Viz: Click a traversal

πŸ•ΈοΈ Graph Algorithms

Breadth-First Search (BFS)

Explores level by level.

A
B
C
D
E
F
Order:

Depth-First Search (DFS)

Explores as far as possible.

A
B
C
D
E
F
Order:

Dijkstra's Algorithm

Shortest path in weighted graphs.

Ex: A→B(4),C(2), B→D(3), C→D(1),E(5), D→E(2)
Click for sim.

Topological Sort

Linear order for DAGs.

Ex Deps: A→B,C; B→D; C→D,E
Click for sim.

⚑ Dynamic Programming

Fibonacci Sequence

DP vs Recursive approach.

Rec: -
DP: -
Res: -

Longest Common Subsequence

LCS of two sequences.

LCS: - | Len: -

0/1 Knapsack Problem

Max value within capacity.

Items (Ex): [W10,V60],[W20,V100],[W30,V120]
Max Value: -

Edit Distance

Min ops to transform strings.

Dist: - ()

Coin Change Problem

Min coins for amount.

Min: -
Combo: -

Longest Increasing Subsequence

LIS of an array.

Len: -
Seq: -

πŸ“š Essential Data Structures

Stack (LIFO)

Last In, First Out.

Stack is empty

Queue (FIFO)

First In, First Out.

Queue is empty

Hash Table

Key-value pairs via hashing.

0:
1:
2:
3:
4:
Hash: key.len % 5

Linked List

Nodes connected by pointers.

Head→
NULL
List is empty

Binary Heap (Min)

Tree-based priority queue.

Heap is empty

Trie (Prefix Tree)

Tree for string prefix search.

Stored: []
Search: -
Trie is empty

πŸš€ Advanced Algorithms

Union-Find (DSU)

Tracks set partitions.

Sets: {0},{1},{2},{3},{4}
Comps: 5

Segment Tree

Range queries/updates (log n).

Build tree first

Fenwick Tree (BIT)

Prefix sums/updates (log n).

Build tree first

Sliding Window Max

Max in all k-size subarrays.

Result: []

LRU Cache

Least Recently Used eviction.

Cache (Cap:3): []
MRU β†’ LRU

Bloom Filter

Probabilistic set membership.

False positive possible.

πŸ“ String Algorithms

KMP Pattern Matching

Knuth–Morris–Pratt Algorithm. Efficient pattern search.

Indices: - | Comp: -

Rabin-Karp Algorithm

Rolling hash pattern search.

Indices: - | Coll: -

Z Algorithm

Linear time pattern search.

Indices: -
Z-Arr: -

Suffix Array / Tree

Suffix-based structures.

Suffixes: -
Array: -

Manacher's Algorithm

Linear time palindrome find.

Longest: -

String Compression (RLE)

Run-length encoding.

Orig: -
Comp: -
Ratio: -