Skip to content

ATHARV-YOGI/Hacktoberfest2024

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Hacktoberfest-2024

Submit your PR on this repo. We are merging all PRs there.


About Our Project "Algorithm Visualizer"

  • Algorithm Visualizer Visualize sorting algorithms in C++ with SDL2 Library

Hacktoberfest 2024 Event Completed

📌 Videos 📽️:

Getting Started 🤩🤗:

  • Fork this repo (button on top)
  • Clone it on your local machine
git clone https://github.com/ATHARV-YOGI/Hacktoberfest2024.git
  • Navigate to the project directory.
cd Hacktoberfest2024
  • Create a new branch
git checkout -b my-new-branch
git add .
  • Commit your changes.
git commit -m "Relevant message"
  • Then push
git push origin my-new-branch
  • Create a new pull request from your forked repository

Avoid Conflicts {Syncing your fork}

An easy way to avoid conflicts is to add an 'upstream' for your git repo, as other PRs may be merged while you're working on your branch/fork.

git remote add upstream https://github.com/ATHARV-YOGI/Hacktoberfest2024

You can verify that the new remote has been added by typing:

git remote -v

To pull any new changes from your parent repo, simply run:

git merge upstream/master

This will give you any eventual conflicts and allow you to easily solve them in your repo. It's a good idea to use it frequently in between your own commits to make sure that your repo is up to date with its parent.

For more information on syncing forks, read this article from GitHub.


More About Algorithm Visualizer

A sorting algorithm is an algorithm that puts the elements of a list in a certain order. While there are a large number of sorting algorithms, in practical implementations a few algorithms predominate. In this implementation of sorting visualizer, we'll be looking at some of these sorting algorithms and visually comprehend their working. The sorting algorithms covered here are Selection Sort, Insertion Sort, Bubble Sort, Merge Sort, Quick Sort and Heap Sort. The list size is fixed to 130 elements. You can randomize the list and select any type of sorting algorithm to call on the list from the given options. Here, all sorting algorithms will sort the elements in ascending order. The sorting time being visualized for an algorithm is not exactly same as their actual time complexities. The relatively faster algorithms like Merge Sort, etc. have been delayed so that they could be properly visualized.

How To Run

You can also run Algorithm Visualizer using the C++ source code available in the repository i.e., Algorithm Visualizer.cpp but you will need to install and setup the SDL2 library first. I recommend you follow Lazy Foo' Productions' tutorial to setup SDL2 Library. PLEASE NOTE THAT the tutorial follows to setup SDL2 32-bit library but to run Algorithm Visualizer, you have to use the 64-bit library. Just use x86_64-w64-mingw32 folder instead of i686-w64-mingw32 to setup the SDL2 files.-> How to download and setup SDL2 library. After setting up the SDL2 library, just include the Algorithm Visualizer.cpp file from the repository in your project with the build options as mentioned in the tutorial and build and run the project.

Controls

WARNING: Giving repetitive commands may cause latency and the visualizer may behave unexpectedly. Please give a new command only after the current command's execution is done.

Available Controls inside Algorithm Visualizer:-

  • Use 0 to Generate a different randomized list.
  • Use 1 to start Selection Sort Algorithm.
  • Use 2 to start Insertion Sort Algorithm.
  • Use 3 to start Bubble Sort Algorithm.
  • Use 4 to start Merge Sort Algorithm.
  • Use 5 to start Quick Sort Algorithm.
  • Use 6 to start Heap Sort Algorithm.
  • Use q to exit out of Algorithm Visualizer

Releases

No releases published

Packages

No packages published

Languages