powered by v43.aiLearn anatomy like an artistDSA
Practise algorithms and data structures through animated models. Foundation enrichment topics.
0 of 14 topics mastered
Explore → practise → quiz → revise. Earlier topics are recommended preparation; every topic stays open.
Start here: Time complexity →Time complexity
DSA enrichmentCompare growth models as the input grows. The counts are illustrative operation families, not measured execution times or universal exact runtimes.
Space complexity
DSA enrichmentCompare constant extra storage, a growing buffer and a recursive call stack. The input itself is not included in these auxiliary-space examples.
Array traversal
DSA enrichmentWalk through an array by index and accumulate a running sum. Every element is visited exactly once.
Palindrome / strings
DSA enrichmentCompare the outside characters and move both pointers towards the centre. This demo ignores spaces and letter case; punctuation remains significant.
Recursion & call stacks
DSA enrichmentUnroll factorial calls to the base case, then watch results return. Each unfinished call waits on the stack.
Bubble sort
DSA enrichmentCompare adjacent values and swap inverted pairs. Each full pass puts the largest remaining value at the end. A no-swap pass stops early.
Selection sort
DSA enrichmentFind the minimum in the unsorted region, then exchange it with the first unsorted element.
Insertion sort
DSA enrichmentTake the next value and shift larger values right until there is room to insert it into the sorted prefix.
Linear search
DSA enrichmentCheck elements from left to right until the target is found or every element is exhausted.
Binary search
DSA enrichmentSearch a sorted copy of the input. Compare the middle value, then discard the half that cannot contain the target. Report an index in the sorted copy.
Prefix sums
DSA enrichmentPrecompute cumulative sums. With prefix[0] = 0, the sum of an inclusive range [l,r] is prefix[r+1] − prefix[l]. The demo asks for the first k values.
Stacks
DSA enrichmentPush onto one end and pop from that same end. The top is always the most recently pushed value that has not yet been removed.
Queues
DSA enrichmentEnqueue at the back and dequeue at the front. This model tracks a head position rather than shifting every remaining value.
Bit operations
DSA enrichmentInspect a nonnegative integer in eight binary places and toggle one chosen bit with XOR. The highlight identifies the place value changed.