∑GateAndNet
PlannerSign Up
🎬 Sorting • Interactive Simulator

Insertion Sort (Adaptive)

Step-by-step adaptive Insertion Sort animation demonstrating sorted prefix invariant, element shifting, best-case Θ(n), and exact Θ(n + I) inversion bound.

All 19 Visualizers Study Notes Solve PYQs

Insertion Sort (Adaptive)

Best Θ(n) • Worst Θ(n²)Space: O(1)StableΘ(n + Inversions)
Comparisons: 0Swaps / Writes: 0
38
[0]
14
[1]
52
[2]
23
[3]
67
[4]
19
[5]
44
[6]
11
[7]
31
[8]
Live Execution Trace
for i = 1 to n - 1:
key = A[i]; j = i - 1
while j >= 0 and A[j] > key:
A[j + 1] = A[j]; j--
A[j + 1] = key // prefix A[0..i] sorted
Initial array of 9 elements ready for INSERTION trace.
1 / 38

Explore All 19 Interactive CSE Simulators

Sorting
Quick Sort (Lomuto Partition)
Sorting
Merge Sort (Divide & Merge)
Sorting
Insertion Sort (Adaptive)
Sorting
Selection Sort (Min-Swap)
Sorting
Bubble Sort (Early-Exit Flag)
Searching & Strings
Binary Search (Interval Halving)
Searching & Strings
KMP String Matching (LPS Table)
Graph Algorithms
Dijkstra Shortest Path (Greedy)
Graph Algorithms
BFS Queue vs DFS Stack Traversal
Logic & OS Systems
OS Page Replacement (LRU vs FIFO)
Logic & OS Systems
1-Bit Full Adder & Universal Gates
Operating Systems
CPU Scheduling Live Gantt Chart (SRTF / RR / SJF / FCFS)
Operating Systems
Banker’s Deadlock Safety Sequence Step-by-Step
Operating Systems
Disk Arm Seek Trajectory Drawing (SSTF / SCAN / C-SCAN / C-LOOK)
Operating Systems
Virtual Memory TLB + 2-Level Page Table Hardware Schematic
Digital Logic
Interactive 4-Variable K-Map Grouping & Prime Implicants
Digital Logic
3-Bit Synchronous Counter & Clock Divider Timing Waveforms
Digital Logic
4×1 Multiplexer Universal Boolean Function Schematic
Digital Logic
32-Bit IEEE-754 Floating-Point Bit-Field Decoder