Skip to content

Program that sorts data on a stack, with a limited set of instructions, using the lowest possible number of actions.

Notifications You must be signed in to change notification settings

lightiverson/push_swap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Push_swap

This project sorts integers on a stack datatype, with a limited set of instructions.

The goal of this project is to learn how to succesfully manipulate various types of searching/sorting algorithms. And to choose the most appropriate solution for your complexity needs.

Result

109%

Features

  • Uses a variation on Radix sort for larger stacks (also uses Bubble sort as a helper function)
  • Uses a custom algorithm (somewhat mix of Insertion sort and Merge sort)
  • Includes a self made checker for bonus

Installation

Clone this repo

    git clone https://github.com/lightiverson/push_swap.git
    cd push_swap
    make

Usage/Examples

Execute push swap

    ./push_swap 0 2 1

Execute checker

    cd checker
    make
    ../push_swap 0 2 1 | ./checker 0 2 1

Appendix

A more detailed explanation of the assignment can be found in the assignment sheet.

About

Program that sorts data on a stack, with a limited set of instructions, using the lowest possible number of actions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published