An interactive lab to see how the algorithms used in the Olympiads in Informatics work: sorting algorithms, binary search and path-finding on a grid. Pick an algorithm, set the speed and follow comparisons, swaps and visited cells step by step.
comparisons 0swaps/writes 0status ready
comparisonswap/writepivotin final position
Complexity
binary search steps 0linear search comparisons –theoretical maximum ⌈log₂(n+1)⌉ –
Pick a value and press Search o Step.
How it works
On a sorted array you look at the middle element: if it is smaller than the value you are looking for, you discard the left half, otherwise the right half. Each step halves the search space: O(log n) instead of O(n).Click and drag to draw walls or mud; drag the green (start) and red (goal) squares to move them.
visited cells 0path length –cost –
visitedfrontierpathwallmud