Skip to content

Write a program in C called push_swap which calculates and displays on the standard output the smallest program using Push_swap instruction language that sorts the integer arguments received.

Notifications You must be signed in to change notification settings

fncbarros/push_swap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

push_swap

Write a program in C called push_swap which calculates and displays on the standard output the smallest program using Push_swap instruction language that sorts the integer arguments received. Implemented radix sort to the bit level. Number of operations is only dependent on number of elements and not configuration, so results tend to repeat. Performance gets better as number of elements grows.

Implemented doubly linked lists holding an int value and specified functions for it Struct holds both stack a and b. Not using most of the operations so not the most efficient algo Failling in cases like taking arguments of the sort "1-1"

Resources: https://medium.com/@jamierobertdawson/push-swap-the-least-amount-of-moves-with-two-stacks-d1e76a71789a https://en.wikipedia.org/wiki/Longest_increasing_subsequence

https://www.youtube.com/watch?v=MuwxQ2IB8lQ https://www.geeksforgeeks.org/void-pointer-c-cpp/ https://www.geeksforgeeks.org/function-pointer-in-c/#:~:text=1)%20Unlike%20normal%20pointers%2C%20a,used%20to%20get%20functions'%20address.

Possibly simpler alternative: https://www.youtube.com/watch?v=sFVxsglODoo&list=WL&index=1

Testing: https://github.com/o-reo/push_swap_visualizer

About

Write a program in C called push_swap which calculates and displays on the standard output the smallest program using Push_swap instruction language that sorts the integer arguments received.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published