This tool brings the Push Swap algorithm to life, making it easier to understand how it works. Push Swap is a program that takes a list of numbers and sorts them using a specific set of instructions. This visualizer allows you to see those instructions play out in real time, helping you grasp the logic behind the algorithm.
Push Swap is a project at 42 School that challenges you to sort a list of numbers using only a specific set of "operations" on two stacks, A and B. ️
You can read the subject here.
This visualizer offers three essential tools to help you master Push Swap:
- Generate consecutive numbers within a specified range (min and max).
- Generate random numbers within a specified range.
See in real-time how operations affect the contents and order of elements in stacks A and B. Understand the flow of the sorting process visually.
- Enter a list of numbers and a sequence of operations.
- Step through each operation one by one.
- Observe the changes in the stacks after each step.
- Debug your own Push Swap implementations by comparing expected behavior.
- Learn and visualize the Push Swap algorithm step-by-step.
- Experiment with different sorting strategies by generating varied input data.
- Gain deeper understanding of the logic behind each operation.
- Debug your own implementations by comparing to the visualizer's results.
This Push Swap Visualizer is readily available online! Just visit:


