Skip to content

SaadLoukili/Push-Swap-Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Push-Swap-Visualizer

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.

What is Push Swap?

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.

How does this visualizer help?

This visualizer offers three essential tools to help you master Push Swap:

1. Random Number Generator:

  • Generate consecutive numbers within a specified range (min and max).
  • Generate random numbers within a specified range. Random Number Generator

2. Stack Visualizer:

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.

Stack Visualizer

3. Stack Viewer:

  • 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. Stack Viewer

Benefits

  • 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.

Getting Started:

This Push Swap Visualizer is readily available online! Just visit:

About

Push Swap Visualizer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors