powered by v43.aiशरीर रचना, एक कलाकार की तरहDSA
Practise algorithms and data structures through animated models. Builder enrichment topics.
0 of 22 topics mastered
Explore → practise → quiz → revise. Earlier topics are recommended preparation; every topic stays open.
Start here: Tower of Hanoi →- Tower of HanoiUp next
- Merge sortExplore
- Quick sortExplore
- Heap sortExplore
- Counting sortExplore
- Two pointers / pair sumExplore
- Fixed sliding windowExplore
- Variable sliding windowExplore
- Kadane’s algorithmExplore
- Merge intervalsExplore
- Linked listsExplore
- Hash tables & collisionsExplore
- Min heaps / priority queuesExplore
- Binary search treesExplore
- Inorder traversalExplore
- Preorder traversalExplore
- Postorder traversalExplore
- Breadth-first searchExplore
- Depth-first searchExplore
- Fibonacci / memoisationExplore
- Greedy interval schedulingExplore
- Binary exponentiationExplore
Tower of Hanoi
DSA enrichmentMove every disk from A to C. Move only one top disk at a time, and never place a larger disk on a smaller one. Study the recursive trace or solve the puzzle yourself.
Merge sort
DSA enrichmentSplit the range into smaller halves, then merge sorted halves with an auxiliary buffer.
Quick sort
DSA enrichmentUse the last value as a pivot. Partition the range so smaller-or-equal values precede the pivot, then recursively sort both sides.
Heap sort
DSA enrichmentBuild a max heap, repeatedly exchange the root with the last active value, then restore the heap in the reduced range.
Counting sort
DSA enrichmentCount each nonnegative integer value, then write values back in increasing order. This version reconstructs values from frequencies; it does not preserve associated records.
Two pointers / pair sum
DSA enrichmentOn a sorted copy, move the left or right pointer according to the pair sum. The target is a required sum, not a value to locate.
Fixed sliding window
DSA enrichmentFind the maximum sum of exactly k consecutive values. Add the incoming value and subtract the outgoing value instead of rebuilding every sum.
Variable sliding window
DSA enrichmentFind the shortest consecutive subarray whose sum is at least a positive target. This shrinking-window strategy here is restricted to nonnegative input values.
Kadane’s algorithm
DSA enrichmentFind a maximum-sum nonempty subarray. At each value, choose whether to extend the previous candidate or start again here. Signed input is allowed for this lesson.
Merge intervals
DSA enrichmentSort intervals by start, then merge each overlap with the active result. Intervals that merely touch are merged in this demo.
Linked lists
DSA enrichmentFollow next links from the head. Values need not live next to each other in memory, so index access requires traversal.
Hash tables & collisions
DSA enrichmentMap each nonnegative key to key mod 5. Store colliding keys in a bucket chain. The table shows why collisions need an explicit policy.
Min heaps / priority queues
DSA enrichmentInsert values into a binary min heap, then extract the minimum. Heap order is local: every parent is no larger than its children; the array need not be globally sorted.
Binary search trees
DSA enrichmentInsert each distinct value by comparing with the current node. Smaller values go left; larger values go right. This demo ignores duplicate insertions.
Inorder traversal
DSA enrichmentBuild the example BST, then visit its nodes in left → node → right order. The call stack shows the recursion that makes the order work.
Preorder traversal
DSA enrichmentBuild the example BST, then visit its nodes in node → left → right order. The call stack shows the recursion that makes the order work.
Postorder traversal
DSA enrichmentBuild the example BST, then visit its nodes in left → right → node order. The call stack shows the recursion that makes the order work.
Breadth-first search
DSA enrichmentExplore a fixed undirected graph from a selected source. A FIFO frontier visits vertices in increasing unweighted distance from that source. Neighbours are considered in increasing vertex order.
Depth-first search
DSA enrichmentExplore a fixed undirected graph by following an unvisited neighbour as far as possible before returning. Neighbours are considered in increasing vertex order.
Fibonacci / memoisation
DSA enrichmentBuild Fibonacci numbers from the base cases and reuse each earlier result rather than recomputing a recursion tree. This bottom-up demo keeps the whole table.
Greedy interval scheduling
DSA enrichmentChoose a maximum-size set of non-overlapping fixed activities. Sort by finish time, then take the next activity that starts at or after the previous finish.
Binary exponentiation
DSA enrichmentCompute a nonnegative whole-number power by repeatedly halving the exponent. Multiply the result by the current base when the low bit of the exponent is 1.