{"id":19079431,"url":"https://github.com/hackersa3edy/sorting_algorithms","last_synced_at":"2025-10-13T17:14:38.757Z","repository":{"id":212921676,"uuid":"731996907","full_name":"hackerSa3edy/sorting_algorithms","owner":"hackerSa3edy","description":"ALX Sprint 2 project - sorting algorithms: A comprehensive study and implementation of various sorting algorithms in C, complete with time complexity analysis.","archived":false,"fork":false,"pushed_at":"2024-08-20T06:46:35.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-02T18:49:42.536Z","etag":null,"topics":["algorithms-analysis","alx-software-engineering","big-o-notation","bubble-sort","c-language","c-programming","heap-sort","insertion-sort","merge-sort","quick-sort","quick-sort-hoare-partition","selection-sort","sorting-algorithms","time-complexity","valgrind"],"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/hackerSa3edy.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-12-15T11:33:46.000Z","updated_at":"2024-08-20T06:46:39.000Z","dependencies_parsed_at":"2024-08-20T08:47:53.907Z","dependency_job_id":"6ca0590d-8383-40c7-8638-a932e8c210ab","html_url":"https://github.com/hackerSa3edy/sorting_algorithms","commit_stats":null,"previous_names":["hackersa3edy/sorting_algorithms"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerSa3edy%2Fsorting_algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerSa3edy%2Fsorting_algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerSa3edy%2Fsorting_algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerSa3edy%2Fsorting_algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackerSa3edy","download_url":"https://codeload.github.com/hackerSa3edy/sorting_algorithms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240131770,"owners_count":19752725,"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":["algorithms-analysis","alx-software-engineering","big-o-notation","bubble-sort","c-language","c-programming","heap-sort","insertion-sort","merge-sort","quick-sort","quick-sort-hoare-partition","selection-sort","sorting-algorithms","time-complexity","valgrind"],"created_at":"2024-11-09T02:14:40.431Z","updated_at":"2025-10-13T17:14:33.693Z","avatar_url":"https://github.com/hackerSa3edy.png","language":"C","readme":"# Project: 0x1B. C - Sorting algorithms \u0026 Big O\n\nThis project is a comprehensive study and implementation of various sorting algorithms in C. It aims to provide a deep understanding of different sorting techniques, their time complexities (Big O notation), and how to select the most efficient algorithm for a given input.\n\n## Learning Objectives\n\n- At the end of this project, you are expected to be able to explain to anyone, without the help of Google:\n  - What is a sorting algorithm\n  - What is the Big O notation, and how to evaluate the time complexity of an algorithm\n  - How to select the best sorting algorithm for a given input\n  - What is a stable sorting algorithm\n\n## Implemented Sorting Algorithms\n\n1. Bubble Sort - [0-bubble_sort.c](0-bubble_sort.c)\n2. Insertion Sort - [1-insertion_sort_list.c](1-insertion_sort_list.c)\n3. Selection Sort - [2-selection_sort.c](2-selection_sort.c)\n4. Quick Sort - [3-quick_sort.c](3-quick_sort.c)\n5. Merge Sort - [103-merge_sort.c](103-merge_sort.c)\n6. Heap Sort - [104-heap_sort.c](104-heap_sort.c)\n\n## Future Implementations\n\n1. Shell Sort\n2. Cocktail Shaker Sort\n3. Counting Sort\n4. Radix Sort\n5. Bitonic Sort\n6. Quick Sort (Hoare partition scheme)\n7. Deck of Cards Sort\n\n## Files\n\n- [sort.h](sort.h): Header file containing all function prototypes and the `listint_t` data structure.\n- [print_array.c](print_array.c): Function to print an array.\n- [print_list.c](print_list.c): Function to print a linked list.\n- `*-O`: Files containing the Big O notation for time complexity of each sorting algorithm.\n\n## Compilation\n\nAll files should be compiled on Ubuntu 20.04 LTS using gcc with the following flags:\n\n```sh\ngcc -Wall -Werror -Wextra -pedantic -std=gnu89\n```\n\n## Usage\n\n```sh\ngcc -Wall -Werror -Wextra -pedantic -std=gnu89 [MAIN_FILE] [SORT_FILE] print_array.c -o [OUTPUT_NAME]\n./[OUTPUT_NAME]\n```\n\nFor example, to run Bubble Sort:\n\n```sh\ngcc -Wall -Werror -Wextra -pedantic -std=gnu89 0-main.c 0-bubble_sort.c print_array.c -o bubble\n./bubble\n```\n\n## Data Structures\n\nThe project uses the following data structure for doubly linked lists:\n\n```c\ntypedef struct listint_s\n{\n    const int n;\n    struct listint_s *prev;\n    struct listint_s *next;\n} listint_t;\n```\n\n## Big O Notation\n\nEach sorting algorithm includes a file with its time complexity in Big O notation:\n\n- Best case scenario\n- Average case scenario\n- Worst case scenario\n\n## Author\n\n- [Abdelrahman Mohamed](https://x.com/hackersa3edy/)\n\n## Acknowledgements\n\nThis project was completed as part of the ALX Software Engineering curriculum.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackersa3edy%2Fsorting_algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackersa3edy%2Fsorting_algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackersa3edy%2Fsorting_algorithms/lists"}