DSA using Python
Lists, trees and pathfinding — animated, step by step.
Introduction to DSA and Python Setup
Watch an accumulator turn three marks into an average, then follow CPython from source to bytecode to running code.
Algorithm Analysis and Complexity
Race four growth curves on one shared scale as n doubles from 4 to 16, then fill a step-count table for a thousand items.
Lists and Arrays
Watch insert(2, 25) shove neighbors aside, slice a list apart, and see why b = a copies a reference instead of a list.
Strings and Character Processing
Two pointers patrol racecar from both ends, then a frequency table counts every vowel in beautiful — one scan, no fuss.
Searching Algorithms
Hunt for 60 in a sorted list as low, mid and high corner it in four probes — then watch linear search crawl.
Sorting Algorithms – Basics
Bars bubble, select and insert their way into order — every compare and swap of the three basic sorts, live on screen.
Efficient Sorting Algorithms
Watch a pivot sweep 19 into place, then follow merge sort’s recursion tree fold eight values into one sorted list.
Recursion and Backtracking Basics
Four factorial frames stack up and pop off in reverse, while fib(4) branches into a tree of repeat calls.
Singly Linked Lists
Follow head and curr down a chain of nodes — splice 63 in mid-list, unlink 24, and watch every rewire.
Doubly and Circular Linked Lists
Rewire prev and next to splice 27 into a doubly chain, then chase curr around a ring that never hits None.
Stacks
Watch a Python list act as a LIFO stack — undo rewinds, brackets balance and a monotonic stack sweeps Next Greater Element.
Queues and Deques
Queue jobs FIFO-style with deque, then watch a circular queue wrap around and a monotonic deque own the sliding window.
Hashing and Dictionaries/Sets
Follow one key through hash, bucket and chain — then watch a set intersect two lists in O(1) probes per item.
Trees and Binary Trees
One binary tree, three walks — recursive inorder, a stack-driven preorder and a queue-powered level sweep.
Binary Search Trees and Heaps
Follow 40 down a BST comparing at every level, then watch heapq heapify a jumbled list and pop the minimum for free.
Graph Fundamentals and Traversals
Build an adjacency dict, then watch BFS ripple across it hop by hop while DFS dives deep — same graph, opposite orders.
Graph Algorithms
Race a min-heap across weighted links to settle cheapest paths, then grow Prim’s cable tree one greedy edge at a time.
Greedy Algorithms
Sort meetings by finish time and book them greedily — then watch coins {4, 3, 1} trip the strategy that 25/10/5/1 never trips.
Dynamic Programming
Fill a knapsack table cell by cell, watch fib’s memo erase repeat work, and learn why the 1-D loop must run backwards.
Advanced Problem Solving and Revision
Converge two pointers onto 11 + 21, slide a window with one add and one drop, and pocket the complexity cheat-sheet.