{"id":19053348,"url":"https://github.com/georgiosioannoucoder/sorting-algorithms","last_synced_at":"2025-10-27T19:03:36.558Z","repository":{"id":217372988,"uuid":"743717244","full_name":"GeorgiosIoannouCoder/sorting-algorithms","owner":"GeorgiosIoannouCoder","description":"Analysis and Implementation of Compiler Time of Six Sorting Algorithms. 📶","archived":false,"fork":false,"pushed_at":"2024-01-17T09:45:46.000Z","size":653,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-02T10:45:38.902Z","etag":null,"topics":["cplusplus","heap-sort","heapsort","insertion-sort","insertionsort","lsd-radix-sort","merge-sort","mergesort","quick-sort","quicksort","randomized-quick-sort","randomizedquicksort","sorting-algorithms","time-complexity"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GeorgiosIoannouCoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-01-15T20:44:13.000Z","updated_at":"2024-01-17T10:12:13.000Z","dependencies_parsed_at":"2024-01-17T11:10:06.199Z","dependency_job_id":"6cc35b25-2b37-4a96-b069-0962f825f60f","html_url":"https://github.com/GeorgiosIoannouCoder/sorting-algorithms","commit_stats":null,"previous_names":["georgiosioannoucoder/sorting-algorithms"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgiosIoannouCoder%2Fsorting-algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgiosIoannouCoder%2Fsorting-algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgiosIoannouCoder%2Fsorting-algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeorgiosIoannouCoder%2Fsorting-algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeorgiosIoannouCoder","download_url":"https://codeload.github.com/GeorgiosIoannouCoder/sorting-algorithms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240109714,"owners_count":19749181,"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":["cplusplus","heap-sort","heapsort","insertion-sort","insertionsort","lsd-radix-sort","merge-sort","mergesort","quick-sort","quicksort","randomized-quick-sort","randomizedquicksort","sorting-algorithms","time-complexity"],"created_at":"2024-11-08T23:30:14.645Z","updated_at":"2025-10-27T19:03:36.494Z","avatar_url":"https://github.com/GeorgiosIoannouCoder.png","language":"C++","readme":"# Reporting and analyzing the compiler time of six Sorting Algorithms\n\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]][license-url]\n[![LinkedIn][linkedin-shield]][linkedin-url]\n[![GitHub][github-shield]][github-url]\n\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"logo.jpg\" alt=\"Logo\"\u003e\n\n\u003ch3 align=\"center\"\u003e\u003ca href=\"https://github.com/GeorgiosIoannouCoder/sorting-algorithms/blob/main/Ioannou_Report.pdf\"\u003eReporting and analyzing the compiler time of six Sorting Algorithms\u003c/a\u003e\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    In this programming assignment, I investigated the compiler time of \u003cb\u003esix different Sorting Algorithms\u003c/b\u003e for different input sizes. The six Sorting Algorithms analyzed in this report are: \u003cb\u003eInsertion Sort, Merge Sort, Heap Sort, Quick Sort, Randomized Quick Sort, and LSD Radix Sort\u003c/b\u003e. A code that was built from scratch was used to generate random arrays of different sizes from 10 to 1000000 an excessively test each Sorting Algorithm. The code is based on the pseudocodes found in the textbook: \u003cb\u003e\"Introduction to Algorithms, THIRD EDITION\"\u003c/b\u003e by Cormen Leiserson,Rivest, and Stein and published by The MIT Press. The program was repeated twice and the average compiler time was reported.\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/GeorgiosIoannouCoder/sorting-algorithms\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/GeorgiosIoannouCoder/sorting-algorithms/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/GeorgiosIoannouCoder/sorting-algorithms/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#sorting-algorithms\"\u003eSorting Algorithms\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#key-feature\"\u003eKey Feature\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#code\"\u003eCode\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#output\"\u003eOutput\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#report\"\u003eReport\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#analysis\"\u003eAnalysis\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n## About The Project\n\n\u003cimg src=\"logo.jpg\" alt=\"Logo\" width=\"200\" height=\"100\"\u003e\n\n### Sorting Algorithms\n\n\u003cimg src=\"time_complexity.png\" alt=\"Sorting Algorithms\"\u003e\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#readme-top\"\u003eBack to top\u003c/a\u003e\u003c/p\u003e\n\n\n### Key Feature\n\n1. **Excessively test each Sorting Algorithm with random arrays of different sizes from 10 to 1000000.**\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#readme-top\"\u003eBack to top\u003c/a\u003e\u003c/p\u003e\n\n### Built With\n\n[![C++][C++]][C++-url]\n[![VisualStudio][VisualStudio]][VisualStudio-url]\n[![Excel][Excel]][Excel-url]\n[![Git][Git]][Git-url]\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#readme-top\"\u003eBack to top\u003c/a\u003e\u003c/p\u003e\n\n## Getting Started\n\n**To get a local copy of this project up and running locally follow these simple example steps:**\n\n### Prerequisites\n\n**NOTE:** How to check if Git is installed and what is its version\n\n```sh\n  git -v\n```\n\n1. Please make sure you have git installed\n\n   - Windows: [https://git-scm.com/download/win](https://git-scm.com/download/win)\n   - Mac: [https://git-scm.com/download/mac](https://git-scm.com/download/mac)\n   - Linux: [https://git-scm.com/download/linux](https://git-scm.com/download/linux)\n\n2. Please make sure you have Visual Studio or Visual Studio Code with the C/C++ extension installed. You can download Visual Studio [here](https://visualstudio.microsoft.com/downloads/). You can download Visual Studio Code [here](https://code.visualstudio.com/download).\n\n***NOTE: You can use whatever code editor that you want. This project was created and tested with Visual Studio.***\n\n### Installation\n\n#### SetUp\n\n1. Navigate to the directory where you want to clone/run/save the application\n\n    ```sh\n    cd your_selected_directory\n    ```\n\n2. Clone this repository\n\n   ```sh\n   git clone https://github.com/GeorgiosIoannouCoder/sorting-algorithms.git\n   ```\n\n3. Navigate to the sorting-algorithms git repository\n\n   ```sh\n   cd sorting-algorithms\n   ```\n\n4. Open your code editor.\n\n   ```sh\n   code .\n   ```\n\n5. Run the .cpp file [here](https://github.com/GeorgiosIoannouCoder/sorting-algorithms/blob/main/Ioannou_Sorting_Algorithms.cpp).\n   \n\u003cp align=\"right\"\u003e\u003ca href=\"#readme-top\"\u003eBack to top\u003c/a\u003e\u003c/p\u003e\n\n## Code\n\nThe main code file can be found [here](https://github.com/GeorgiosIoannouCoder/sorting-algorithms/blob/main/Ioannou_Sorting_Algorithms.cpp).\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#readme-top\"\u003eBack to top\u003c/a\u003e\u003c/p\u003e\n\n## Output\n\nThe code of this project produces an output similiar to this:\n\n\u003cimg src=\"Table_1.png\" alt=\"Logo\"\u003e\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#readme-top\"\u003eBack to top\u003c/a\u003e\u003c/p\u003e\n\n## Report\n\nThe report of this project is located [here](https://github.com/GeorgiosIoannouCoder/sorting-algorithms/blob/main/Ioannou_Report.pdf). The tables and graph found inside the Report are loacted [here](https://github.com/GeorgiosIoannouCoder/sorting-algorithms/blob/main/Tables.xlsx).\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#readme-top\"\u003eBack to top\u003c/a\u003e\u003c/p\u003e\n\n## Analysis\n\nAs I stated in my hypothesis in the [Report](https://github.com/GeorgiosIoannouCoder/sorting-algorithms/blob/main/Ioannou_Report.pdf) and by studying Table 3 and Figure 1, the **slowest Sorting Algorithm is Insertion Sort** and the **fastest Sorting Algorithm is LSD Radix Sort** among these six Algorithms. I was also correct that Quick Sort beats Heap Sort which beats Merge Sort. **However, Randomized Quick Sort (picking random pivot) is not faster than Quick Sort (picking the last element as the pivot)**. In fact, Randomized Quick Sort is sometimes slower than Heap Sort such as in the case when the input size is N=1000000. However, as the table shows, **Insertion Sort even though it is a quadratic Sorting Algorithm it is faster than Merge Sort, Randomized Quick Sort, and LSD Radix Sort for small array sizes and nearly sorted arrays**. Insertion Sort starts to be slow when the input size N gets larger.\n\n\u003cimg src=\"Table_1_excel.png\" alt=\"Table 1\"\u003e\n\n\u003cimg src=\"Table_2_excel.png\" alt=\"Table 2\"\u003e\n\n\u003cimg src=\"Table_3_excel.png\" alt=\"Table 3\"\u003e\n\n\u003cimg src=\"time_vs_input.png\" alt=\"Time versus input\"\u003e\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#readme-top\"\u003eBack to top\u003c/a\u003e\u003c/p\u003e\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\nDon't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#readme-top\"\u003eBack to top\u003c/a\u003e\u003c/p\u003e\n\n## License\n\nDistributed under the MIT License. See [LICENSE](https://github.com/GeorgiosIoannouCoder/sorting-algorithms/blob/master/LICENSE) for more information.\n\nMIT License\n\nCopyright (c) 2021 Georgios Ioannou\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#readme-top\"\u003eBack to top\u003c/a\u003e\u003c/p\u003e\n\n## Contact\n\nGeorgios Ioannou - [@LinkedIn](https://linkedin.com/in/georgiosioannoucoder)\n\nGeorgios Ioannou - [@georgiosioannoucoder](https://georgiosioannoucoder.github.io/) - Please contact me via the form in my portfolio.\n\nProject Link: [https://github.com/GeorgiosIoannouCoder/sorting-algorithms](https://github.com/GeorgiosIoannouCoder/sorting-algorithms)\n\n\u003cp align=\"right\"\u003e\u003ca href=\"#readme-top\"\u003eBack to top\u003c/a\u003e\u003c/p\u003e\n\n[contributors-shield]: https://img.shields.io/github/contributors/GeorgiosIoannouCoder/sorting-algorithms.svg?style=for-the-badge\n[contributors-url]: https://github.com/GeorgiosIoannouCoder/sorting-algorithms/graphs/contributors\n\n[forks-shield]: https://img.shields.io/github/forks/GeorgiosIoannouCoder/sorting-algorithms.svg?style=for-the-badge\n[forks-url]: https://github.com/GeorgiosIoannouCoder/sorting-algorithms/network/members\n\n[stars-shield]: https://img.shields.io/github/stars/GeorgiosIoannouCoder/sorting-algorithms.svg?style=for-the-badge\n[stars-url]: https://github.com/GeorgiosIoannouCoder/sorting-algorithms/stargazers\n\n[issues-shield]: https://img.shields.io/github/issues/GeorgiosIoannouCoder/sorting-algorithms.svg?style=for-the-badge\n[issues-url]: https://github.com/GeorgiosIoannouCoder/sorting-algorithms/issues\n\n[license-shield]: https://img.shields.io/github/license/GeorgiosIoannouCoder/sorting-algorithms.svg?style=for-the-badge\n[license-url]: https://github.com/GeorgiosIoannouCoder/sorting-algorithms/blob/master/LICENSE\n\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge\u0026logo=linkedin\u0026colorB=0077B5\n[linkedin-url]: https://linkedin.com/in/georgiosioannoucoder\n\n[github-shield]: https://img.shields.io/badge/-GitHub-black.svg?style=for-the-badge\u0026logo=github\u0026colorB=000\n[github-url]: https://github.com/GeorgiosIoannouCoder/\n\n[C++]: https://img.shields.io/badge/c++-d5e4f3?style=for-the-badge\u0026logo=cplusplus\u0026logoColor=044f88\n[C++-url]: https://cplusplus.com/\n\n[VisualStudio]: https://img.shields.io/badge/visual%20studio-5d2b90?style=for-the-badge\u0026logo=visualstudio\u0026logoColor=ffffff\n[VisualStudio-url]: https://visualstudio.microsoft.com/\n\n[Excel]: https://img.shields.io/badge/microsoft%20excel-1d6f42?style=for-the-badge\u0026logo=microsoft\n[Excel-url]: https://www.microsoft.com/en-us/microsoft-365\n\n[Git]: https://img.shields.io/badge/git-000000?style=for-the-badge\u0026logo=git\u0026logoColor=orange\n[Git-url]: https://git-scm.com/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgiosioannoucoder%2Fsorting-algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorgiosioannoucoder%2Fsorting-algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgiosioannoucoder%2Fsorting-algorithms/lists"}