{"id":20305259,"url":"https://github.com/hamzaelkhatri/push_swap","last_synced_at":"2025-07-24T06:05:17.356Z","repository":{"id":117980701,"uuid":"346380573","full_name":"Hamzaelkhatri/push_swap","owner":"Hamzaelkhatri","description":"The aim of this project is to sort data on a stack, with a limited set of instructions, using the lowest possible number of actions","archived":false,"fork":false,"pushed_at":"2021-05-25T11:53:54.000Z","size":11872,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-04T07:23:26.537Z","etag":null,"topics":["ai","c","push-swap","quicksort","sort"],"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/Hamzaelkhatri.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":"2021-03-10T14:20:13.000Z","updated_at":"2024-03-05T14:34:49.000Z","dependencies_parsed_at":"2023-03-30T14:05:38.563Z","dependency_job_id":null,"html_url":"https://github.com/Hamzaelkhatri/push_swap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Hamzaelkhatri/push_swap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamzaelkhatri%2Fpush_swap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamzaelkhatri%2Fpush_swap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamzaelkhatri%2Fpush_swap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamzaelkhatri%2Fpush_swap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hamzaelkhatri","download_url":"https://codeload.github.com/Hamzaelkhatri/push_swap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamzaelkhatri%2Fpush_swap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266801421,"owners_count":23986371,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ai","c","push-swap","quicksort","sort"],"created_at":"2024-11-14T17:07:56.715Z","updated_at":"2025-07-24T06:05:17.328Z","avatar_url":"https://github.com/Hamzaelkhatri.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# push_swap\nsort data on a stack, with a limited set of instructions, using the lowest possible number of actions\n\n## Concept of this Project ##\n\n\n## Push_Swap Algorithm ::\n\u003ca href=\"https://diyanazizo13.medium.com/fastest-push-swap-algorithm-2f510028602b\"\u003ePush_Swap Algorithm\u003c/a\u003e\n\n The idea is simple, You have two stacks called Stack A and Stack B. \u003cbr\u003e\n Stack A is given a random list of unorganized numbers.  \u003cbr\u003e\n You must take the random list of numbers in Stack A and sort them so that Stack A is organized from smallest to largest. \u003cbr\u003e \n There are only a few moves you’re allowed to used to manipulate the stacks that we’re going to call “Actions”.  \u003cbr\u003e\n The main goal of this project is to organize Stack A in as few actions as possible. \u003cbr\u003e\n\n ## MOVES ##\n\nthe moves are named:  sa, sb, ss, ra, rb, rr, rra, rrb, rrr, pa, pb.\u003cbr\u003e\nI use Double linked list to implement these moves :\u003cbr\u003e\n\n## sa || sb :arrows_clockwise:  ##\n    -swap 2 first element\n\u003ca href=\"https://ibb.co/wC6FY2V\"\u003e\u003cimg src=\"https://i.ibb.co/828LXQq/Screen-Shot-2021-04-03-at-12-44-32-PM.png\" alt=\"Screen-Shot-2021-04-03-at-12-44-32-PM\" border=\"0\"\u003e\u003c/a\u003e\n##  :arrow_heading_up: ra || rb :arrow_right_hook:\t ##\n    -put the first element last,and all elemnt go UP by one \n\u003ca href=\"https://ibb.co/9ggTtbY\"\u003e\u003cimg src=\"https://i.ibb.co/YQQkZcj/Screen-Shot-2021-04-03-at-2-51-42-PM.png\" alt=\"Screen-Shot-2021-04-03-at-2-51-42-PM\" border=\"0\"\u003e\u003c/a\u003e\n\n##  :arrow_heading_down: rra || rrb :arrows_counterclockwise: ##\n    -put the last element First, so all elements go DOWN by ine element \n\u003ca href=\"https://ibb.co/k6NrLj8\"\u003e\u003cimg src=\"https://i.ibb.co/KzTQtdq/Screen-Shot-2021-04-03-at-5-26-13-PM.png\" alt=\"Screen-Shot-2021-04-03-at-5-26-13-PM\" border=\"0\"\u003e\u003c/a\u003e\n\n## pa || pb :arrow_right: ##\n    -take the first element at the top of a stack and put it at the top of other_stack.\n\u003ca href=\"https://ibb.co/Byf5G3C\"\u003e\u003cimg src=\"https://i.ibb.co/qND3Cjr/Screen-Shot-2021-04-03-at-6-41-55-PM.png\" alt=\"Screen-Shot-2021-04-03-at-6-41-55-PM\" border=\"0\"\u003e\u003c/a\u003e\n\u003ca href=\"https://ibb.co/j4Kjp2F\"\u003e\u003cimg src=\"https://i.ibb.co/kcnPdfF/Screen-Shot-2021-04-04-at-3-27-57-PM.png\" alt=\"Screen-Shot-2021-04-04-at-3-27-57-PM\" border=\"0\"\u003e\u003c/a\u003e\n\n## Checker:\n    -Thanks to the checker program, you will be able to check if the\n    list of instructions you’ll generate with the program push_swap is\n    actually sorting the stack properly.\n\n## This is how much instriction the algorithm Do with 100 random number \n\u003ca href=\"https://ibb.co/TTbfy6W\"\u003e\u003cimg src=\"https://i.ibb.co/j5WNtmJ/Screen-Shot-2021-04-11-at-2-46-15-PM.png\" alt=\"Screen-Shot-2021-04-11-at-2-46-15-PM\" border=\"0\"\u003e\u003c/a\u003e\n\n\u003ca href=\"https://ibb.co/Rb0SvY5\"\u003e\u003cimg src=\"https://i.ibb.co/jfM56bp/Screen-Shot-2021-04-11-at-2-33-56-PM.png\" alt=\"Screen-Shot-2021-04-11-at-2-33-56-PM\" border=\"0\"\u003e\u003c/a\u003e\n\n## To Test\n Try to use : ./push_swap -h \"this command will show what to do \" \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamzaelkhatri%2Fpush_swap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamzaelkhatri%2Fpush_swap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamzaelkhatri%2Fpush_swap/lists"}