{"id":22513308,"url":"https://github.com/malk97sc/sorting_algorithm","last_synced_at":"2025-09-04T02:39:53.209Z","repository":{"id":265003131,"uuid":"894808635","full_name":"Malk97sc/Sorting_Algorithm","owner":"Malk97sc","description":"Sorting Algorithms","archived":false,"fork":false,"pushed_at":"2025-03-07T03:21:00.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T01:27:28.627Z","etag":null,"topics":["algorithms-and-data-structures","c","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/Malk97sc.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-27T03:05:41.000Z","updated_at":"2025-03-07T03:21:05.000Z","dependencies_parsed_at":"2024-12-01T20:01:20.893Z","dependency_job_id":"3411a3f9-862c-4cd0-b515-160477d417e0","html_url":"https://github.com/Malk97sc/Sorting_Algorithm","commit_stats":null,"previous_names":["malk97sc/sorting_algorithm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Malk97sc/Sorting_Algorithm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Malk97sc%2FSorting_Algorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Malk97sc%2FSorting_Algorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Malk97sc%2FSorting_Algorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Malk97sc%2FSorting_Algorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Malk97sc","download_url":"https://codeload.github.com/Malk97sc/Sorting_Algorithm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Malk97sc%2FSorting_Algorithm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273543115,"owners_count":25124266,"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-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["algorithms-and-data-structures","c","sorting-algorithms"],"created_at":"2024-12-07T03:11:09.233Z","updated_at":"2025-09-04T02:39:53.164Z","avatar_url":"https://github.com/Malk97sc.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Sorting Algorithms \n\n**Sorting Algorithms**, is a collection of efficient and commonly used sorting algorithms implemented in C. This project is perfect for those studying algorithms or data structures.\n\n## Features\n\n- **Comprehensive Algorithm Support**: Implementations include classic sorting techniques such as Bubble Sort, Quick Sort, Merge Sort, and more.\n- **Performance Analysis**: Each algorithm includes its time complexity (Big-O notation) for better understanding and comparison.\n- **Educational Value**: Ideal for learning how different sorting algorithms work and their use cases.\n\n## Getting Started\n\nFollow these steps to explore and execute the sorting algorithms.\n\n### 1. Prerequisites\n\n- A Linux-based operating system (tested on Linux Mint).\n- GCC (GNU Compiler Collection) installed on your system.\n\n### 2. Compiling the Code\n\nUse the following command to compile a specific sorting algorithm:\n\n```bash\ngcc bubble.c -o bubble\n```\n\nReplace `bubble.c` with the desired file name (e.g., `quickSort.c`).\n\n### 3. Running the Program\n\nRun the compiled program to see the sorting in action:\n\n```bash\n./bubble\n```\n\n## Algorithms Included\n\nBelow is a list of sorting algorithms, with brief descriptions and their time complexities:\n\n### 1. Bubble Sort (`bubble.c`)\n- **Description**: Compares adjacent elements and swaps them if they are in the wrong order. Repeats this process until the array is sorted.\n- **Complexity**: \n  - Best: O(n)\n  - Average: O(n²)\n  - Worst: O(n²)\n\n### 2. Counting Sort (`couting.c`)\n- **Description**: Sorts integers by counting the occurrences of each value and calculating their positions.\n- **Complexity**: \n  - Best, Average, Worst: O(n + k) (where `k` is the range of input values)\n\n### 3. Insertion Sort (`insertion.c`)\n- **Description**: Builds the sorted array one element at a time by inserting each element into its correct position.\n- **Complexity**: \n  - Best: O(n)\n  - Average: O(n²)\n  - Worst: O(n²)\n\n### 4. Quick Sort (`quickSort.c`)\n- **Description**: Divides the array into two smaller sub-arrays around a pivot and recursively sorts them.\n- **Complexity**: \n  - Best: O(n log n)\n  - Average: O(n log n)\n  - Worst: O(n²)\n\n### 5. Selection Sort (`selection.c`)\n- **Description**: Repeatedly selects the smallest (or largest) element and swaps it with the first unsorted element.\n- **Complexity**: \n  - Best, Average, Worst: O(n²)\n\n### 6. Bucket Sort (`bucket.c`)\n- **Description**: Divides the array into buckets and sorts each bucket individually.\n- **Complexity**: \n  - Best: O(n + k)\n  - Average: O(n + k)\n  - Worst: O(n²)\n\n### 7. Heap Sort (`heap.c`)\n- **Description**: Uses a binary heap data structure to repeatedly extract the maximum (or minimum) element.\n- **Complexity**: \n  - Best, Average, Worst: O(n log n)\n\n### 8. Merge Sort (`mergesort.c`)\n- **Description**: Divides the array into halves, sorts each half recursively, and merges them back together.\n- **Complexity**: \n  - Best, Average, Worst: O(n log n)\n\n### 9. Radix Sort (`radix.c`)\n- **Description**: Sorts numbers by processing individual digits from least to most significant.\n- **Complexity**: \n  - Best, Average, Worst: O(nk) (where `k` is the number of digits)\n\n### 10. Shell Sort (`shell.c`)\n- **Description**: An optimized version of insertion sort that uses a gap sequence to reduce comparisons.\n- **Complexity**: \n  - Best: O(n log n)\n  - Average: Depends on gap sequence\n  - Worst: O(n²)\n\n## How It Works\n\nEach algorithm is implemented in its respective `.c` file. The programs take an unsorted array as input, apply the sorting technique, and display the sorted array.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalk97sc%2Fsorting_algorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalk97sc%2Fsorting_algorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalk97sc%2Fsorting_algorithm/lists"}