bogosort visualization
watch the bogosort algorithm shuffle and check for order from left to right
bogosort algorithm
every second, exactly one action happens: either shuffle the array (all bars turn black) or check if one element is in order (turn it gray if yes, or reset if no).
Iterations: 0 | Status: Stopped
how it works
algorithm steps:
- shuffle the array randomly (all bars return to black)
- check the first element (always highlight it gray)
- check the next element: if it's ≥ the previous, highlight it gray
- if an element is < the previous, stop and go back to step 1
- if all elements get highlighted, the array is sorted!
- each step takes exactly 300 miliseconds
visual indicators:
- normal bars (unsorted or incorrect position)
- gray bars (correctly ordered from the left)