BigβO Complexity Visualizer - Online Compare O(1) to O(n!)
Plot different BigβO complexities on a chart. See how O(log n) stays flat while O(2^n) explodes. Educational reference.
UD5 Toolkit
Watch Bubble, Quick & Merge Sort in action β step by step
| Algorithm | Best | Average | Worst | Space | Stable |
|---|---|---|---|---|---|
| Bubble Sort | O(n) | O(nΒ²) | O(nΒ²) | O(1) | Yes |
| Quick Sort | O(n log n) | O(n log n) | O(nΒ²) | O(log n) | No |
| Merge Sort | O(n log n) | O(n log n) | O(n log n) | O(n) | Yes |
A sorting algorithm rearranges elements of a list or array into a specific order β typically numerical ascending or descending. Sorting is fundamental in computer science, enabling efficient searching, data analysis, and optimized algorithms that rely on ordered data.
Bubble Sort repeatedly steps through the list, compares adjacent elements, and swaps them if they're in the wrong order. Larger elements "bubble up" to the end with each pass. It's intuitive but inefficient β O(nΒ²) in average and worst cases β making it impractical for large datasets.
Quick Sort picks a "pivot" element, partitions the array so that smaller elements are left of the pivot and larger ones are right, then recursively sorts the sub-arrays. It averages O(n log n) and is often the fastest in practice due to cache efficiency, though worst-case is O(nΒ²).
Merge Sort divides the array into halves, recursively sorts each half, then merges the sorted halves back together. It guarantees O(n log n) in all cases and is stable, but requires O(n) extra space, making it ideal when stability and predictability matter.
In practice, Quick Sort is usually fastest for general-purpose in-memory sorting due to low constant factors and cache locality. However, Merge Sort is more predictable and excels with linked lists or external data. For very small arrays, insertion sort (not shown here) can beat both.
A stable sorting algorithm preserves the relative order of equal elements. If two items have the same key, their original order is maintained after sorting. Merge Sort and Bubble Sort are stable; Quick Sort (typical implementations) is not. Stability matters when sorting by multiple criteria.
Use Bubble Sort only for educational purposes or tiny datasets (n < 20). For real applications, Quick Sort is the default choice for arrays in most programming languages' standard libraries. If stability or guaranteed O(n log n) is required, consider Merge Sort or Timsort.
An in-place sorting algorithm uses O(1) or O(log n) extra space beyond the input array. Bubble Sort is in-place (O(1)). Quick Sort is in-place (O(log n) for recursion stack). Merge Sort is not in-place β it requires O(n) auxiliary space for merging.
Plot different BigβO complexities on a chart. See how O(log n) stays flat while O(2^n) explodes. Educational reference.
Add, remove, push, pop items and watch the data structure change visually. Supports arrays, stacks, and queues. For CS students.
Drag a slider to see wind speed in knots/mph/kmh and the corresponding sea conditions and land effects.
Compare standard keyboard layouts side-by-side. Click keys to see characters. Useful for learning alternative layouts.
Enter an amount and see a virtual stack of $100 bills with height comparison to everyday objects.
Simulate paint colors on a pre-loaded room photo by adjusting hue, saturation. Find your perfect shade before buying. Local canvas.
Start from a base color and use `oklch(from color l c h)` to create lighter or darker variants. Copy the code.
Enter a simple regular expression and see its equivalent Deterministic Finite Automaton diagram. Learn how regex engines work.
See the complete recursion tree for small Fibonacci or factorial calculations. Understand overlapping subproblems. Educational.
Press any key combination and see the humanβreadable shortcut for macOS and Windows. Developer docs helper.
Define password rules and see a live checklist that updates as you type. Design better password UX for your app.
Touch your screen and see the pressure and radius reported. Visualize force. Mobile developer tool.
Highlight elements with ariaβdescribedby and see the linked description text. Verify a11y annotations.
Watch a simulation of how the JavaScript event loop handles synchronous code, microtasks, and macrotasks. Learn async.
Paste a website's HTML and see which text is only visible to screen readers (e.g., .srβonly). Preview the accessible layer.
Pick two colors and mix them in different color spaces with sliders. See the difference between sRGB and OKLCH mixing. Copy the code.
Simulate a traceroute by entering a destination IP. Learn about AS paths and latency. Does not send real packets; educational visualisation.
Call navigator.storage.estimate() and display a visual pie chart of used vs. available browser storage. For PWA debugging.
Paste a JSON object and see a dynamic, draggable tree graph representation. Excellent for debugging nested data.
Evaluate password strength through a short interactive story where each character set adds lines to a narrative. Educational fun.
Type a password and see a bar that fills based on estimated bits of entropy. Colorβcoded feedback. No storage.
Click to see a famous physics formula rendered in LaTeX, with a short description. For daily science inspiration. All local.
Enter two tire sizes and see a sideβbyβside comparison of diameter, width, and speedometer error. Local math.
Upload an audio clip and generate an animated GIF of its waveform dancing. Shareable sound snippet. Canvas magic.
Adjust margin, border, padding, and content sizes interactively and see the rendered box model. Get the exact CSS. Teach or learn layout.
Draw walls on a grid and watch A*, Dijkstra, or BFS find the shortest path. Interactive animation. Learn graph traversal.
Enter a regular expression and see a visual railroad diagram explaining the pattern. Learn and debug regex.
Upload a small file to see each byte as a block, color-coded by value. Visualize the structure of binary data. Client-side.
See interactive Venn diagrams for SQL JOINs: INNER, LEFT, RIGHT, FULL, CROSS. Understand set theory visually. Local static site.
Visualize audio in real time from your microphone or uploaded audio file. See the waveform dance. Uses Web Audio API locally.