DEV Community

DSA & Algorithms in Python Series' Articles

Back to Bimal Kshetri's Series
The Complete DSA and Algorithms Series in Python: Every Post, In Order
Cover image for The Complete DSA and Algorithms Series in Python: Every Post, In Order

The Complete DSA and Algorithms Series in Python: Every Post, In Order

Comments
8 min read
What Is DSA? Data Structures and Algorithms Explained for Complete Beginners
Cover image for What Is DSA? Data Structures and Algorithms Explained for Complete Beginners

What Is DSA? Data Structures and Algorithms Explained for Complete Beginners

Comments
16 min read
Python From Zero: The Complete Beginner's Guide to the Language
Cover image for Python From Zero: The Complete Beginner's Guide to the Language

Python From Zero: The Complete Beginner's Guide to the Language

Comments
46 min read
Big O Notation: How to Measure an Algorithm Without Running It
Cover image for Big O Notation: How to Measure an Algorithm Without Running It

Big O Notation: How to Measure an Algorithm Without Running It

Comments
23 min read
Bubble Sort in Python: The Algorithm Everyone Learns First
Cover image for Bubble Sort in Python: The Algorithm Everyone Learns First

Bubble Sort in Python: The Algorithm Everyone Learns First

Comments
11 min read
Selection Sort in Python: The Fewest Swaps of Any Simple Sort
Cover image for Selection Sort in Python: The Fewest Swaps of Any Simple Sort

Selection Sort in Python: The Fewest Swaps of Any Simple Sort

Comments
15 min read
Insertion Sort in Python: The Fast One Nobody Expects
Cover image for Insertion Sort in Python: The Fast One Nobody Expects

Insertion Sort in Python: The Fast One Nobody Expects

Comments
16 min read
Merge Sort in Python: Guaranteed O(n log n), Every Single Time
Cover image for Merge Sort in Python: Guaranteed O(n log n), Every Single Time

Merge Sort in Python: Guaranteed O(n log n), Every Single Time

Comments
17 min read
Quick Sort in Python: The Fastest Sort in Practice, and Its One Weakness
Cover image for Quick Sort in Python: The Fastest Sort in Practice, and Its One Weakness

Quick Sort in Python: The Fastest Sort in Practice, and Its One Weakness

Comments
18 min read
Heap Sort in Python: O(n log n) Without Using Extra Memory
Cover image for Heap Sort in Python: O(n log n) Without Using Extra Memory

Heap Sort in Python: O(n log n) Without Using Extra Memory

Comments
18 min read
Counting Sort in Python: Sorting Without Comparing Anything
Cover image for Counting Sort in Python: Sorting Without Comparing Anything

Counting Sort in Python: Sorting Without Comparing Anything

Comments
21 min read
Radix Sort in Python: Sorting Digit by Digit, Faster Than O(n log n)
Cover image for Radix Sort in Python: Sorting Digit by Digit, Faster Than O(n log n)

Radix Sort in Python: Sorting Digit by Digit, Faster Than O(n log n)

Comments
17 min read
Timsort: The Algorithm Behind Python's sorted() and list.sort()
Cover image for Timsort: The Algorithm Behind Python's sorted() and list.sort()

Timsort: The Algorithm Behind Python's sorted() and list.sort()

Comments
24 min read
Linear Search in Python: The Simplest Algorithm, and When It's Still Right
Cover image for Linear Search in Python: The Simplest Algorithm, and When It's Still Right

Linear Search in Python: The Simplest Algorithm, and When It's Still Right

Comments
15 min read
Binary Search in Python: Halving the Problem Every Step
Cover image for Binary Search in Python: Halving the Problem Every Step

Binary Search in Python: Halving the Problem Every Step

Comments
21 min read
Arrays and Dynamic Arrays: How Python Lists Actually Work
Cover image for Arrays and Dynamic Arrays: How Python Lists Actually Work

Arrays and Dynamic Arrays: How Python Lists Actually Work

Comments
18 min read
Linked Lists in Python: Singly, Doubly, and Circular, From Scratch
Cover image for Linked Lists in Python: Singly, Doubly, and Circular, From Scratch

Linked Lists in Python: Singly, Doubly, and Circular, From Scratch

Comments
22 min read
Stacks in Python: Last In, First Out, and Where You Already Use One
Cover image for Stacks in Python: Last In, First Out, and Where You Already Use One

Stacks in Python: Last In, First Out, and Where You Already Use One

Comments
17 min read
Queues and Deques in Python: FIFO, Ring Buffers, and collections.deque
Cover image for Queues and Deques in Python: FIFO, Ring Buffers, and collections.deque

Queues and Deques in Python: FIFO, Ring Buffers, and collections.deque

Comments
19 min read
Hash Tables in Python: How Dictionaries Get O(1) Lookups
Cover image for Hash Tables in Python: How Dictionaries Get O(1) Lookups

Hash Tables in Python: How Dictionaries Get O(1) Lookups

Comments
22 min read
Binary Search Trees in Python: Ordered Data That Stays Fast
Cover image for Binary Search Trees in Python: Ordered Data That Stays Fast

Binary Search Trees in Python: Ordered Data That Stays Fast

Comments
18 min read
AVL Trees and Self-Balancing: Fixing the Binary Search Tree's Worst Case
Cover image for AVL Trees and Self-Balancing: Fixing the Binary Search Tree's Worst Case

AVL Trees and Self-Balancing: Fixing the Binary Search Tree's Worst Case

Comments
26 min read
Heaps and Priority Queues in Python: Always Knowing the Smallest Item
Cover image for Heaps and Priority Queues in Python: Always Knowing the Smallest Item

Heaps and Priority Queues in Python: Always Knowing the Smallest Item

Comments
26 min read
Tries in Python: The Data Structure Behind Autocomplete
Cover image for Tries in Python: The Data Structure Behind Autocomplete

Tries in Python: The Data Structure Behind Autocomplete

Comments
20 min read
Union-Find (Disjoint Set) in Python: Tracking Connected Things Fast
Cover image for Union-Find (Disjoint Set) in Python: Tracking Connected Things Fast

Union-Find (Disjoint Set) in Python: Tracking Connected Things Fast

Comments
23 min read
Graphs in Python: Adjacency Lists, Matrices, and Which to Use
Cover image for Graphs in Python: Adjacency Lists, Matrices, and Which to Use

Graphs in Python: Adjacency Lists, Matrices, and Which to Use

Comments
20 min read
Breadth-First Search (BFS) in Python: Shortest Paths, Level by Level
Cover image for Breadth-First Search (BFS) in Python: Shortest Paths, Level by Level

Breadth-First Search (BFS) in Python: Shortest Paths, Level by Level

Comments
18 min read
Depth-First Search (DFS) in Python: Going Deep Before Going Wide
Cover image for Depth-First Search (DFS) in Python: Going Deep Before Going Wide

Depth-First Search (DFS) in Python: Going Deep Before Going Wide

Comments
21 min read
Dijkstra's Algorithm in Python: Shortest Paths With Weighted Edges
Cover image for Dijkstra's Algorithm in Python: Shortest Paths With Weighted Edges

Dijkstra's Algorithm in Python: Shortest Paths With Weighted Edges

Comments
19 min read
Bellman-Ford in Python: Shortest Paths When Edges Can Be Negative
Cover image for Bellman-Ford in Python: Shortest Paths When Edges Can Be Negative

Bellman-Ford in Python: Shortest Paths When Edges Can Be Negative

Comments
23 min read
Floyd-Warshall in Python: Shortest Paths Between Every Pair of Nodes
Cover image for Floyd-Warshall in Python: Shortest Paths Between Every Pair of Nodes

Floyd-Warshall in Python: Shortest Paths Between Every Pair of Nodes

Comments
22 min read
A* Search in Python: Dijkstra With a Sense of Direction
Cover image for A* Search in Python: Dijkstra With a Sense of Direction

A* Search in Python: Dijkstra With a Sense of Direction

Comments
23 min read
Minimum Spanning Trees in Python: Kruskal's and Prim's Algorithms
Cover image for Minimum Spanning Trees in Python: Kruskal's and Prim's Algorithms

Minimum Spanning Trees in Python: Kruskal's and Prim's Algorithms

Comments
24 min read
Topological Sort in Python: Ordering Tasks That Depend on Each Other
Cover image for Topological Sort in Python: Ordering Tasks That Depend on Each Other

Topological Sort in Python: Ordering Tasks That Depend on Each Other

Comments
19 min read
Dynamic Programming Explained: Memoization, Tabulation, and How to Spot It
Cover image for Dynamic Programming Explained: Memoization, Tabulation, and How to Spot It

Dynamic Programming Explained: Memoization, Tabulation, and How to Spot It

Comments
19 min read
The 0/1 Knapsack Problem in Python: The Classic DP Every Interview Uses
Cover image for The 0/1 Knapsack Problem in Python: The Classic DP Every Interview Uses

The 0/1 Knapsack Problem in Python: The Classic DP Every Interview Uses

Comments
21 min read
Longest Common Subsequence in Python: How diff Tools Work
Cover image for Longest Common Subsequence in Python: How diff Tools Work

Longest Common Subsequence in Python: How diff Tools Work

Comments
17 min read
Edit Distance (Levenshtein) in Python: Measuring How Different Two Strings Are
Cover image for Edit Distance (Levenshtein) in Python: Measuring How Different Two Strings Are

Edit Distance (Levenshtein) in Python: Measuring How Different Two Strings Are

Comments
20 min read
The Coin Change Problem in Python: Where Greedy Fails and DP Wins
Cover image for The Coin Change Problem in Python: Where Greedy Fails and DP Wins

The Coin Change Problem in Python: Where Greedy Fails and DP Wins

Comments
21 min read
Greedy Algorithms Explained: When Taking the Best Option Now Actually Works
Cover image for Greedy Algorithms Explained: When Taking the Best Option Now Actually Works

Greedy Algorithms Explained: When Taking the Best Option Now Actually Works

Comments
17 min read
Huffman Coding in Python: How Compression Actually Compresses
Cover image for Huffman Coding in Python: How Compression Actually Compresses

Huffman Coding in Python: How Compression Actually Compresses

Comments
23 min read
Recursion and Backtracking in Python: Building the Mental Model
Cover image for Recursion and Backtracking in Python: Building the Mental Model

Recursion and Backtracking in Python: Building the Mental Model

Comments
19 min read
The N-Queens Problem in Python: Backtracking at Its Clearest
Cover image for The N-Queens Problem in Python: Backtracking at Its Clearest

The N-Queens Problem in Python: Backtracking at Its Clearest

Comments
18 min read
The KMP Algorithm in Python: String Search Without Ever Going Backwards
Cover image for The KMP Algorithm in Python: String Search Without Ever Going Backwards

The KMP Algorithm in Python: String Search Without Ever Going Backwards

Comments
19 min read
Rabin-Karp in Python: Finding Substrings With Rolling Hashes
Cover image for Rabin-Karp in Python: Finding Substrings With Rolling Hashes

Rabin-Karp in Python: Finding Substrings With Rolling Hashes

Comments
19 min read
The Euclidean Algorithm in Python: The Oldest Algorithm Still in Daily Use
Cover image for The Euclidean Algorithm in Python: The Oldest Algorithm Still in Daily Use

The Euclidean Algorithm in Python: The Oldest Algorithm Still in Daily Use

Comments
18 min read
Sieve of Eratosthenes in Python: Every Prime Under a Million, Fast
Cover image for Sieve of Eratosthenes in Python: Every Prime Under a Million, Fast

Sieve of Eratosthenes in Python: Every Prime Under a Million, Fast

Comments
20 min read
Fast Exponentiation in Python: Computing Huge Powers in log n Steps
Cover image for Fast Exponentiation in Python: Computing Huge Powers in log n Steps

Fast Exponentiation in Python: Computing Huge Powers in log n Steps

Comments
15 min read
The Two Pointers Technique in Python: Turning O(n ) Into O(n)
Cover image for The Two Pointers Technique in Python: Turning O(n ) Into O(n)

The Two Pointers Technique in Python: Turning O(n ) Into O(n)

Comments
20 min read
The Sliding Window Technique in Python: Subarray Problems Made Linear
Cover image for The Sliding Window Technique in Python: Subarray Problems Made Linear

The Sliding Window Technique in Python: Subarray Problems Made Linear

Comments
22 min read
Prefix Sums in Python: Answering Range Queries in Constant Time
Cover image for Prefix Sums in Python: Answering Range Queries in Constant Time

Prefix Sums in Python: Answering Range Queries in Constant Time

Comments
20 min read
Building an LRU Cache in Python: The Data Structure Behind Every Cache
Cover image for Building an LRU Cache in Python: The Data Structure Behind Every Cache

Building an LRU Cache in Python: The Data Structure Behind Every Cache

Comments
22 min read