Skip to content

This project involves sorting data on a stack, with a limited set of instructions, and the smallest number of moves. acquiring the skills to manipulate various sorting algorithms and choose the most appropriate solution(s) for optimized data sorting is essential.

Notifications You must be signed in to change notification settings

tarikkudesu/push_swap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This project involves sorting data on a stack, with a limited set of instructions, and the smallest number of moves. Acquiring the skills to manipulate various sorting algorithms and choose the most appropriate solution(s) for optimized data sorting is essential.

Description

  • This project is implemented in c and is compilable with a Makefile.
  • Memory leaks free, Memory leaks are not to be tolerated.
  • Error free, an error displayed in case something went wrong.
  • The program takes a list of numbers to be sorted.
  • The program has two stacks; a and b, initial a is full and b is empty.
  • There is only a limited set of instruction possible (swap a, swap b, swap a b, push a, push b, rotate a, rotate b, rotate a b, reverse rotate a, reverse rotate b, reverse rotate a b).
  • The program implements a sorting algorithm.
  • The program displays the smallest list of instructions possible to sort the stack a, the smallest number being at the top.
  • Stack b is always empty at the end of the program.
  • 100 random numbers can be sorted in under 700 instruction.
  • 500 random numbers can be sorted in under 5500 instruction.
  • As a bonus, An extra checker program is implemented that can reads instruction and displays OK if the numbers are sorted, KO otherwise.

New Concepts

  • LIFO Behavior
  • Algorithmic Thinking
  • Sorting Concepts
  • State Management
  • Operation Simulation
  • Complexity Awareness

About

This project involves sorting data on a stack, with a limited set of instructions, and the smallest number of moves. acquiring the skills to manipulate various sorting algorithms and choose the most appropriate solution(s) for optimized data sorting is essential.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published