{"id":26657015,"url":"https://github.com/shreyas9699/sorting-visualization","last_synced_at":"2025-03-25T08:16:31.426Z","repository":{"id":244648675,"uuid":"815847272","full_name":"Shreyas9699/Sorting-Visualization","owner":"Shreyas9699","description":"This repo visualizes various sorting algorithms using SDL (Simple DirectMedia Layer). The code is designed to run an application that graphically demonstrates how different sorting algorithms work. ","archived":false,"fork":false,"pushed_at":"2024-06-18T06:31:21.000Z","size":5472,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-18T07:24:22.821Z","etag":null,"topics":["conditional-variables","cpp20","mutex","mutex-lock","oops-in-cpp","rendering","sdl2","sdl2-ttf","sorting-algorithms-implemented","sorting-visualization","thread"],"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/Shreyas9699.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":"2024-06-16T10:51:12.000Z","updated_at":"2024-06-18T06:31:24.000Z","dependencies_parsed_at":"2024-06-16T12:24:07.857Z","dependency_job_id":"e7f8f2a8-0579-4784-b7e8-4bc0344dec65","html_url":"https://github.com/Shreyas9699/Sorting-Visualization","commit_stats":null,"previous_names":["shreyas9699/sorting-visualization"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shreyas9699%2FSorting-Visualization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shreyas9699%2FSorting-Visualization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shreyas9699%2FSorting-Visualization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shreyas9699%2FSorting-Visualization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shreyas9699","download_url":"https://codeload.github.com/Shreyas9699/Sorting-Visualization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245423253,"owners_count":20612749,"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":["conditional-variables","cpp20","mutex","mutex-lock","oops-in-cpp","rendering","sdl2","sdl2-ttf","sorting-algorithms-implemented","sorting-visualization","thread"],"created_at":"2025-03-25T08:16:30.880Z","updated_at":"2025-03-25T08:16:31.416Z","avatar_url":"https://github.com/Shreyas9699.png","language":"C++","readme":"# Sorting Visualization\n\nSorting Visualization is a graphical application that visualizes various sorting algorithms using SDL (Simple DirectMedia Layer) and SDL_ttf (SDL TrueType Font). The application demonstrates how different sorting algorithms work by providing a visual representation of the sorting process. The latest update introduces multi-threading to separate the sorting and rendering processes, improving performance and responsiveness.\n\n## Video Demonstration\n\nhttps://github.com/Shreyas9699/Sorting-Visualization/assets/63774467/625be771-1627-437b-9098-31c8d469c0f7\n\n\n\n## Features\n\n- Visualizes the following sorting algorithms:\n  - Bubble Sort\n  - Selection Sort\n  - Insertion Sort\n  - Binary Insertion Sort\n  - Shell Sort\n  - Heap Sort\n  - Quick Sort\n  - Merge Sort\n  - Counting Sort (*Positive Integers Only*)\n  - Radix Sort (*Positive Integers Only*)\n  - Bucket Sort (*Positive Integers Only*)\n- Allows both positive and negative integers (*flag to include negavtive integers*)\n- Adjustable number of elements to sort\n- Customizable window size\n- Real-time sorting process visualization\n- Time measurement for sorting process\n\n## Prerequisites\n\n### General\n\n- [SDL2](https://github.com/libsdl-org/SDL/releases)\n- [SDL_ttf](https://github.com/libsdl-org/SDL_ttf/releases)\n- [SDL_image](https://github.com/libsdl-org/SDL_image/releases)\n- C++20 compatible compiler\n\n### Windows (Visual Studio)\n\n1. **Update C++ Version to 20:**\n\n   - Go to your project properties.\n   - Under `Configuration Properties` \u003e `General`, set the `C++ Language Standard` to `ISO C++20 Standard (/std:c++20)`.\n\n2. **Add Include Directories:**\n\n   - Go to `Configuration Properties` \u003e `VC++ Directories` \u003e `Include Directories`.\n   - Add the following paths: (Might differ, select where you have copied the downloaded SDL files)\n     ```\n     C:\\libraries\\SDL2\\SDL2-2.30.3\\include\n     C:\\libraries\\SDL2\\SDL2_image-2.8.2\\include\n     C:\\libraries\\SDL2\\SDL2_ttf-2.22.0\\include\n     ```\n\n3. **Add Library Directories:**\n\n   - Go to `Configuration Properties` \u003e `VC++ Directories` \u003e `Library Directories`.\n   - Add the following paths: (Might differ, select where you have copied the downloaded SDL files)\n     ```\n     C:\\libraries\\SDL2\\SDL2-2.30.3\\lib\\x64\n     C:\\libraries\\SDL2\\SDL2_image-2.8.2\\lib\\x64\n     C:\\libraries\\SDL2\\SDL2_ttf-2.22.0\\lib\\x64\n     ```\n\n4. **Add Linker Dependencies:**\n\n   - Go to `Configuration Properties` \u003e `Linker` \u003e `Input` \u003e `Additional Dependencies`.\n   - Add the following libraries:\n     ```\n     SDL2.lib\n     SDL2main.lib\n     SDL2_ttf.lib\n     SDL2_image.lib\n     ```\n\n5. **Update System Environment Path:**\n\n   - If you encounter `SDL2_ttf.dll not found` error when running the project, add the SDL library directory to your system environment variable `PATH`.\n     ```\n     C:\\libraries\\SDL2\\SDL2-2.30.3\\lib\\x64\n     C:\\libraries\\SDL2\\SDL2_image-2.8.2\\lib\\x64\n     C:\\libraries\\SDL2\\SDL2_ttf-2.22.0\\lib\\x64\n     ```\n\n   Refer to [Setting up SDL2 in Windows (Visual Studio)](https://www.studyplan.dev/sdl-dev/sdl-setup-windows) for detailed steps.\n\n## Getting Started\n\n### Installation\n\n1. **Clone the repository:**\n\n    ```sh\n    git clone https://github.com/Shreyas9699/Sorting-Visualization.git\n    cd Sorting-Visualization\n    ```\n\n### Build and Run\n\n1. **Build the project:**\n\n    - Open the solution file in Visual Studio.\n    - Build the project by selecting `Build` \u003e `Build Solution` or pressing `Ctrl+Shift+B`.\n\n2. **Run the application:**\n\n    - Run the project by selecting `Debug` \u003e `Start Debugging` or pressing `F5`.\n\n## Usage\n\n1. **Select the number of elements to sort:**\n   - Enter a value between 10 and 1440 in console.\n\n2. **Select the sorting algorithm:**\n   - Choose an algorithm by entering the corresponding number:\n     ```\n     1. Bubble Sort\n     2. Selection Sort\n     3. Insertion Sort\n     4. Binary Insertion Sort\n     5. Shell Sort\n     6. Heap Sort\n     7. Quick Sort\n     8. Merge Sort\n     9. Counting Sort\n     10. Radix Sort\n     11. Bucket Sort\n     ```\n\n3. **Visualization:**\n   - Watch the sorting process in real-time.\n   - The application will display the time taken for the sorting process upon completion.\n\n4. **Reset:**\n   - After the sorting is done, you can close the SDL window by clicking on close button or ESC key.\n   - You can then choose to reset and try another configuration by entering 'Y' when prompted.\n\n## Code Overview\n\n- **Engine.h \u0026 Engine.cpp:**\n  - Contains the `Engine` class which manages the application state, rendering, and interaction with sorting algorithms.\n\n- **main.cpp:**\n  - Handles user input to configure and run the sorting visualization.\n  - Validates input and initializes the `Engine` object.\n\n- **SortingAlgo.h:**\n  - Contains implementations of various sorting algorithms.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request for any bug fixes or enhancements.\n\n## Acknowledgements\n\n- [SDL](https://www.libsdl.org/)\n- [SDL_ttf](https://www.libsdl.org/projects/SDL_ttf/)\n- [SDL_image](https://www.libsdl.org/projects/SDL_image/)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshreyas9699%2Fsorting-visualization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshreyas9699%2Fsorting-visualization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshreyas9699%2Fsorting-visualization/lists"}