DEV Community

Bimal Kshetri profile picture

Bimal Kshetri

It is better to fail in originality than to succeed in imitation.

Location Pokhara, Nepal Joined Joined on  Personal website https://bimalkhatri.com.np/
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
Prefix Sums in Python: Answering Range Queries in Constant Time

Prefix Sums in Python: Answering Range Queries in Constant Time

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

The Sliding Window Technique in Python: Subarray Problems Made Linear

Comments
22 min read
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
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
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
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
Rabin-Karp in Python: Finding Substrings With Rolling Hashes

Rabin-Karp in Python: Finding Substrings With Rolling Hashes

Comments
19 min read
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
The N-Queens Problem in Python: Backtracking at Its Clearest

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

Comments
18 min read
Recursion and Backtracking in Python: Building the Mental Model

Recursion and Backtracking in Python: Building the Mental Model

Comments
19 min read
Huffman Coding in Python: How Compression Actually Compresses

Huffman Coding in Python: How Compression Actually Compresses

Comments
23 min read
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
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
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
Longest Common Subsequence in Python: How diff Tools Work

Longest Common Subsequence in Python: How diff Tools Work

Comments
17 min read
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
Dynamic Programming Explained: Memoization, Tabulation, and How to Spot It

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

Comments
19 min read
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
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
A* Search in Python: Dijkstra With a Sense of Direction

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

Comments
23 min read
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
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
Dijkstra's Algorithm in Python: Shortest Paths With Weighted Edges

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

Comments
19 min read
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
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
Graphs in Python: Adjacency Lists, Matrices, and Which to Use

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

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

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

Comments
23 min read
Tries in Python: The Data Structure Behind Autocomplete

Tries in Python: The Data Structure Behind Autocomplete

Comments
20 min read
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
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
Binary Search Trees in Python: Ordered Data That Stays Fast

Binary Search Trees in Python: Ordered Data That Stays Fast

Comments
18 min read
Hash Tables in Python: How Dictionaries Get O(1) Lookups

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

Comments
22 min read
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
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
Linked Lists in Python: Singly, Doubly, and Circular, From Scratch

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

Comments
22 min read
Arrays and Dynamic Arrays: How Python Lists Actually Work

Arrays and Dynamic Arrays: How Python Lists Actually Work

Comments
18 min read
Binary Search in Python: Halving the Problem Every Step

Binary Search in Python: Halving the Problem Every Step

Comments
21 min read
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
Timsort: The Algorithm Behind Python's sorted() and list.sort()

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

Comments
24 min read
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
Counting Sort in Python: Sorting Without Comparing Anything

Counting Sort in Python: Sorting Without Comparing Anything

Comments
21 min read
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
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
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
Insertion Sort in Python: The Fast One Nobody Expects

Insertion Sort in Python: The Fast One Nobody Expects

Comments
16 min read
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
Bubble Sort in Python: The Algorithm Everyone Learns First

Bubble Sort in Python: The Algorithm Everyone Learns First

Comments
11 min read
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
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
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
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
Vulpecula Constellation: The Little Fox, the Dumbbell Nebula, and the First Pulsar

Vulpecula Constellation: The Little Fox, the Dumbbell Nebula, and the First Pulsar

Comments
5 min read
Volans Constellation: The Flying Fish, Skimming Past the Large Magellanic Cloud

Volans Constellation: The Flying Fish, Skimming Past the Large Magellanic Cloud

Comments
5 min read
Virgo Constellation: The Maiden, and the Largest Galaxy Cluster We Can See

Virgo Constellation: The Maiden, and the Largest Galaxy Cluster We Can See

Comments
5 min read
Vela Constellation: The Sails, a Pulsar, and the False Cross

Vela Constellation: The Sails, a Pulsar, and the False Cross

Comments
5 min read
Ursa Minor Constellation: The Little Bear and Polaris, the Star That Never Moves

Ursa Minor Constellation: The Little Bear and Polaris, the Star That Never Moves

Comments
5 min read
Ursa Major Constellation: The Great Bear, the Big Dipper, and How to Find North

Ursa Major Constellation: The Great Bear, the Big Dipper, and How to Find North

Comments
6 min read
Tucana Constellation: The Toucan, the Small Magellanic Cloud, and 47 Tucanae

Tucana Constellation: The Toucan, the Small Magellanic Cloud, and 47 Tucanae

Comments
5 min read
Triangulum Constellation: A Simple Triangle Hiding the Third Galaxy of Our Local Group

Triangulum Constellation: A Simple Triangle Hiding the Third Galaxy of Our Local Group

Comments
5 min read
loading...