Skip to content

maxon755/42_push_swap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42_push_swap

42school algorythm project. The goal is to sort given stack of integers, using a limited number of operations and one more additional stack.

Available operation:

  1. Swap two numbers at the top of the stack. [sa, sb, ss]
  2. Rotate number from the top to the bottom of the stack. [ra, rb, rr]
  3. Rotate number from the bottom to the top of the stack. [rra, rrb, rrr]
  4. Push number from the one stack the another. [pa, pb]

Usage ./push_swap [numbers] | ./checker [numbers]

push_swap prints the necessary operation to sort stack;

checker checks will be the stack sorted using this operations;

To visualize sorting process use ./run.sh [n],

python2.x and matplotlib required

where n - quantity of numbers, which will be generated randomly.

Example: sorting_process

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published