Radix sort is a non-comparative sorting algorithm. It avoids comparison by creating and distributing elements into buckets according to their radix.
The task is to create a program that handles a certain amount of randomly ordered numbers and sorts them with the fewest possible moves, while adhering to specific limitations on the allowed operations. The limitations are as follows:
You can only use two stacks, labeled A and B. The allowed operations are as follows: Push operation: Move the first element from stack A to stack B, or vice versa. Rotate operation: Increase or decrease the position of a number in a stack by one. Swap operation: Exchange the positions of the first and second numbers in a stack.
Use this tool to visualize the operations. By default operations will be display in terminal.
https://github.com/o-reo/push_swap_visualizer
git clone
cd push_swap
make
./push_swap <random nbr> <random nbr> <random nbr> ...