{"id":25394889,"url":"https://github.com/azersd/ksort-push_swap","last_synced_at":"2025-07-17T02:32:24.958Z","repository":{"id":157296479,"uuid":"588848718","full_name":"AzerSD/ksort-push_swap","owner":"AzerSD","description":"push_swap is a sorting algorithm based on sorting two stacks with the least amount of moves.","archived":false,"fork":false,"pushed_at":"2023-12-15T20:27:33.000Z","size":50,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T19:52:50.357Z","etag":null,"topics":["42","42heilbronn","42network","algorithms","data-structures","k-sort","ksort","push-swap","pushswap","pushswap-42"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AzerSD.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-14T08:10:59.000Z","updated_at":"2025-01-22T19:49:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c39d7c4-ca01-40aa-9b39-7d3ff62a9252","html_url":"https://github.com/AzerSD/ksort-push_swap","commit_stats":null,"previous_names":["azersd/ksort-push_swap"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzerSD%2Fksort-push_swap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzerSD%2Fksort-push_swap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzerSD%2Fksort-push_swap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AzerSD%2Fksort-push_swap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AzerSD","download_url":"https://codeload.github.com/AzerSD/ksort-push_swap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225657,"owners_count":21068078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["42","42heilbronn","42network","algorithms","data-structures","k-sort","ksort","push-swap","pushswap","pushswap-42"],"created_at":"2025-02-15T19:52:15.581Z","updated_at":"2025-04-10T13:19:34.374Z","avatar_url":"https://github.com/AzerSD.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# push_swap\n\n\u003cimg width=\"842\" alt=\"image\" src=\"https://github.com/AzerSD/push_swap/assets/56733438/e2a4cc04-f1f8-4c0c-baac-4c1c81498b8b\"\u003e\n\npush_swap is a sorting algorithm based on sorting two stacks with the least amount of moves.\nThe allowed moves are:\n\n* sa (swap a): Swap the first 2 elements at the top of stack a.\n* sb (swap b): Swap the first 2 elements at the top of stack b.\n* ss : sa and sb at the same time.\n* pa (push a): Take the first element at the top of b and put it at the top of a.\n* pb (push b): Take the first element at the top of a and put it at the top of b.\n* ra (rotate a): Shift up all elements of stack a by 1. First becomes last.\n* rb (rotate b): Shift up all elements of stack b by 1. First becomes last.\n* rr : ra and rb at the same time.\n* rra (reverse rotate a): Shift down all elements of stack a by 1. Last becomes first.\n* rrb (reverse rotate b): Shift down all elements of stack b by 1. Last becomes first.\n* rrr : rra and rrb at the same time.\n\n\u003e\u003e By using these moves, the goal is to sort the numbers in stack A in ascending order, using stack B as a temporary storage.\n\n\u003e\u003e This algorithm is considered to be one of the simplest sorting algorithm, but it can be quite hard to optimize it and sort a large amount of numbers with a low amount of moves.\n\n# The Algorithm:\n\n\nhttps://user-images.githubusercontent.com/56733438/213343838-583f273e-b108-4648-8d9c-8b2b95d1554b.mov\n\n# ksort\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazersd%2Fksort-push_swap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazersd%2Fksort-push_swap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazersd%2Fksort-push_swap/lists"}