
Data Structures & Algorithms in Python
The interview-grade DSA toolkit, coded from scratch in Python.
From Big-O to greedy algorithms, this book builds every core data structure and algorithmic pattern by hand in Python. Each chapter is a self-contained capsule that turns a Leetcode-style problem into a reusable technique you can carry into any interview.
Read on your Kindle
We'll send this whole book straight to your Kindle — it opens natively, so you can resize the text, read fully offline, and it remembers where you left off. Nothing to download or manage.
Sending to Kindle is for subscribers — subscribe to read the whole library on your Kindle.
00Foundations & Python Refresher7 capsules
Foundations & Python Refresher — 7 chapters.
01Why Data Structures & Algorithms?conceptfree13 min02Setting Up Python: Interpreter & REPLcode🔒13 min03A Fast Tour of the Python Languagecode🔒11 min04Variables, Data Types, Casting & Operatorscode🔒15 min05Control Flow: Conditionals, Loops & Functionscode🔒13 min06Object-Oriented Python for Data Structurescode🔒12 min07Big-O: Time & Space Complexitymath🔒15 min01Arrays & Matrices9 capsules
Arrays & Matrices — 9 chapters.
08Introduction to Python Arraysconcept🔒12 min09Reverse an Array & Rotate by D Placescode🔒15 min10Generate All Subarrays & Search Unsortedcode🔒13 min11Max, Min & K-th Smallest/Largestcode🔒15 min12Two Sum & Contains Duplicatecode🔒13 min13Introduction to 2D Arraysconcept🔒13 min14Transpose & Rotate a Matrixcode🔒13 min15Print a Matrix in Snake Patterncode🔒13 min16Spiral Traversal of a Matrixcode🔒13 min02Strings, Sets & Dictionaries8 capsules
Strings, Sets & Dictionaries — 8 chapters.
17Introduction to Stringsconcept🔒13 min18All Substrings & Reverse a Stringcode🔒13 min19Palindrome String & Palindromic Substringscode🔒15 min20Remove Occurrences & Camel-Case a Sentencecode🔒16 min21Introduction to Setsconcept🔒14 min22Unique Characters & Pangram with Setscode🔒16 min23Introduction to Python Dictionariesconcept🔒13 min24Frequency Counting: Vowels, Uniques & Pangramcode🔒14 min03Two Pointers & Sliding Window6 capsules
Two Pointers & Sliding Window — 6 chapters.
25The Two-Pointers Techniqueintuition🔒14 min26Remove Duplicates from a Sorted Arraycode🔒11 min27Boats to Save People (Leetcode 881)project🔒11 min28The Sliding-Window Techniqueintuition🔒14 min29Contains Duplicate II (Leetcode 219)code🔒12 min30Longest Substring Without Repeating Characterscode🔒11 min04Searching, Sorting & Bit Manipulation8 capsules
Searching, Sorting & Bit Manipulation — 8 chapters.
31Linear Searchcode🔒12 min32Binary Search on a Sorted Arraymath🔒13 min33Bubble Sortcode🔒13 min34Selection Sortcode🔒13 min35Introduction to Bit Manipulationconcept🔒12 min36Single Element Among Doublescode🔒11 min37Counting Bitscode🔒11 min38Power of Twocode🔒13 min05Stacks & Queues10 capsules
Stacks & Queues — 9 chapters.
39Introduction to the Stackconcept🔒11 min40Previous Smaller & Greater Elementcode🔒12 min41Valid Parenthesescode🔒11 min42Daily Temperaturescode🔒13 min43Use Side Lanecode🔒12 min44Introduction to the Queueconcept🔒12 min45Implement a Stack Using Queuescode🔒11 min46Implement a Queue Using Stackscode🔒11 min47Reverse First K Elements of a Queuecode🔒12 min48Sliding Window Maximumdeep-dive🔒12 min06Linked Lists7 capsules
Linked Lists — 7 chapters.
49Introduction to the Linked Listconcept🔒13 min50Remove the N-th Node from the Endcode🔒14 min51Rotate a Linked Listcode🔒12 min52Reverse a Linked Listcode🔒12 min53Find the Middle of a Linked Listcode🔒11 min54Detect a Cycle (Floyd's Algorithm)math🔒12 min55Merge Two Sorted Linked Listscode🔒12 min07Recursion & Backtracking6 capsules
Recursion & Backtracking — 6 chapters.
56Introduction to Recursionintuition🔒12 min57Recursive Traversal, Fibonacci & Factorialcode🔒13 min58Climbing Stairsmath🔒12 min59Generate All Subsequencescode🔒13 min60Follow the Knight: The Knight's Tourdeep-dive🔒12 min61Find All Permutationsproject🔒12 min08Greedy Algorithms & Capstone8 capsules
Greedy Algorithms & Capstone — 8 chapters.
62Introduction to Greedy: Chocolate Distributionintuition🔒14 min63Minimum Platformscode🔒11 min64N Meetings in One Roomcode🔒11 min65Maximum Units on a Truckcode🔒12 min66Minimum Arrows to Burst Balloonscode🔒11 min67Gas Stationdeep-dive🔒13 min68Choosing the Right Patternintuition🔒13 min69Capstone: The Interview Playbookproject🔒11 minRatings & reviews
No ratings yet. Yours would be the first.