{"id":22249330,"url":"https://github.com/carlosrocha-dev/42_push_swap","last_synced_at":"2025-03-25T12:14:29.578Z","repository":{"id":168074966,"uuid":"643693895","full_name":"carlosrocha-dev/42_push_swap","owner":"carlosrocha-dev","description":"This project is about sort data on a stack, with a limited set of instructions, using the lowest possible number of actions. To succeed it must have to manipulate various types of algorithms and choose the most appropriate solution (out of many) for an optimized data sorting.","archived":false,"fork":false,"pushed_at":"2023-05-23T01:21:05.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-30T11:10:02.139Z","etag":null,"topics":["42cursus","42projects","42school","42sp","algorithm-implementation","battery-concept-and-handling-elements","sorting-algorithms"],"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/carlosrocha-dev.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-05-22T00:31:47.000Z","updated_at":"2023-05-23T12:48:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"d49174b0-da7a-4109-93c0-fe881357237a","html_url":"https://github.com/carlosrocha-dev/42_push_swap","commit_stats":null,"previous_names":["carlosrocha-dev/42_push_swap"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosrocha-dev%2F42_push_swap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosrocha-dev%2F42_push_swap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosrocha-dev%2F42_push_swap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlosrocha-dev%2F42_push_swap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carlosrocha-dev","download_url":"https://codeload.github.com/carlosrocha-dev/42_push_swap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245458703,"owners_count":20618697,"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":["42cursus","42projects","42school","42sp","algorithm-implementation","battery-concept-and-handling-elements","sorting-algorithms"],"created_at":"2024-12-03T06:26:03.191Z","updated_at":"2025-03-25T12:14:29.542Z","avatar_url":"https://github.com/carlosrocha-dev.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e \n\n![image](https://github.com/carlosrocha-dev/42_push_swap/assets/3737837/0a006021-b54b-48cb-b1d1-a59ee0435dfd)\n\n# 42 Push Swap\n\n\u003c/div\u003e \n\nhttps://github.com/carlosrocha-dev/42_push_swap/assets/3737837/fae34478-1b6b-41b9-82a6-92309e4dfab4\n\n\u003c/div\u003e\n\n## Because Swap_push isn’t as natural\n   \n---\n\nThis project is about sort data on a stack, with a limited set of instructions, using\nthe lowest possible number of actions. To succeed it must have to manipulate various\ntypes of algorithms and choose the most appropriate solution (out of many) for an\noptimized data sorting.\n\n## Optimized Sorting Algorithm: Radix Sort with Bitwise Operations\n\nDuring our journey at 42 São Paulo, we faced a complex challenge: to sort data on a stack with a restricted set of instructions, and to minimize the number of actions taken. To accomplish this task, it was necessary to manipulate and adapt different types of algorithms, choosing the most suitable solution for optimized data sorting.\n\nData sorting is fundamental in computer science, especially when dealing with large volumes of data. In this situation, choosing an efficient sorting algorithm that fits the restrictions of the problem is crucial.\n\nFacing this challenge, I chose to use Radix Sort, an efficient and effective method of data sorting. This algorithm, despite its simplicity, has speed and accuracy that allow for efficient data sorting.\n\nRadix Sort begins by identifying the number with the most digits, which will be the basis for determining how many times the sorting process will be repeated. It then goes through the stack of numbers, but instead of analyzing the digits in a conventional way, it uses bitwise operations. This allows the algorithm to analyze the binary digits of each number, from right to left, reorganizing the stack according to the value of each bit.\n\nIf the analyzed bit is 1, the number is moved to the top of the stack. If the bit is 0, the number is moved to a second stack. This process is repeated until all bits of all numbers have been analyzed.\n\nFinally, all the numbers from the second stack are returned to the original stack, completing one pass of the algorithm. This process is repeated until the entire stack is sorted.\n\nWhile it may seem complex at first reading, the execution of Radix Sort using bitwise operations is simple and efficient, making it an excellent option for sorting data on a stack.\n\n## How to run\n\n1. Clone the project: ```git@github.com:carlosrocha-dev/42_push_swap.git```\n2. Go to the folder: ```cd 42_push_swap```\n3. Run the commands\n```Bash\n\u003e make\n```\n\n```Bash\n\u003e make test100\n```\n\n```Bash\n\u003e make test500\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlosrocha-dev%2F42_push_swap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlosrocha-dev%2F42_push_swap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlosrocha-dev%2F42_push_swap/lists"}