Create a web application using HTML, CSS, Javascript to visualize how various sorting algorithms work. This project’s functionality will be similar to this application.
Create a web application using HTML, CSS, Javascript to visualize how various sorting algorithms work. This project’s functionality will be similar to this application.
We have learnt sorting algorithms like bubble sort, selection sort, insertion sort, quick sort. But often we fail to understand the core idea of a particular algorithm maybe because we are unable to visualize how they work. So the most important thing to understand about these algorithms is visualization.
That’s why we are making this project to let everyone understand how these algorithms work and through this project you also will get a deep understanding of such sorting algorithms.
This project will guide you step by step to complete this project and at the end of this project you will have an immense grip on some core concepts of Javascript as well. Adding this project on your resume will showcase your skills and add a great value to your profile.
This project is a good start for beginners and a refresher for professionals who have dabbled in data structures and algorithms using Javascript before and also web developers. The methodology can be applied to showcase any algorithm of one's choosing, so feel free to innovate!
At the end of this project you will have built an app which would function like this -
Create a web application using HTML, CSS, Javascript to visualize how various sorting algorithms work. This project’s functionality will be similar to this application.
We have learnt sorting algorithms like bubble sort, selection sort, insertion sort, quick sort. But often we fail to understand the core idea of a particular algorithm maybe because we are unable to visualize how they work. So the most important thing to understand about these algorithms is visualization.
That’s why we are making this project to let everyone understand how these algorithms work and through this project you also will get a deep understanding of such sorting algorithms.
This project will guide you step by step to complete this project and at the end of this project you will have an immense grip on some core concepts of Javascript as well. Adding this project on your resume will showcase your skills and add a great value to your profile.
This project is a good start for beginners and a refresher for professionals who have dabbled in data structures and algorithms using Javascript before and also web developers. The methodology can be applied to showcase any algorithm of one's choosing, so feel free to innovate!
At the end of this project you will have built an app which would function like this -
First validate the idea by doing a low level implementation (Proof of concept) of the components involved in the project.
In this milestone the basic structure of this website will be made. In this milestone you will mainly use HTML. Then in the next milestone we will add Bootstrap and CSS for styling purposes.
Since only HTML has been used the site should look something like this.
The web app's basic skeleton UI was created in the previous task. To make the app more attractive and interactive we will employ CSS and Bootstrap for styling purposes.
<button type="button" class="btn btn-dark bubble sort" >Bubble sort</button>
Expected Outcome
section as your starter template. Do not think about the bars and other components except the buttons. Bars and other components will be addressed in the upcoming milestones. Feel free to innovate and come up with your own styles.Bootstrap Docs
given in the references. You can simply copy the code for your favourite outcome from the website and paste it to your code editor. Then you can customize elements in your own way.After styling using CSS and Bootstrap the site should look something like this.
From this milestone onwards we will start implementing the animations and other core functionalities of the application. In this milestone we will create bars of different heights; which basically indicates the array that we will sort. Through these bars we will visualize how sorting algorithms work.
After adding the bars the site looks something like this.
Before starting this task, understand the Bubble Sort algorithm thoroughly.
function swap(el1,el2)
{
const style1 = window.getComputedStyle(el1);
const style2 = window.getComputedStyle(el2);
const transform1 = style1.getPropertyValue("height");
const transform2 = style2.getPropertyValue("height");
el1.style.height = transform2;
el2.style.height = transform1;
}
special[j].style.background="red";
special[j+1].style.background="red";
await new Promise(resolve => setTimeout(() => {resolve(), delay(2)}));
Again before starting this task understand the Selection Sort, Insertion Sort, quick Sort, Merge sort algorithms thoroughly.
<span>
//no of bars
<input id="arr_sz" type="range" min=20 max=120 step=1 value=60>
</span>
var arr_size=document.querySelector("#arr_sz");
var no_of_bar=arr_size.value;
arr_size.addEventListener("input",create_bars);
After implementing all the functionalities the end result of your app should be like this -
After completing all the milestones we have our application ready to be deployed and hosted live onto the web.
Start off by pushing your code to your GitHub account with a good README.md to publish your project.
Host your app live using Netlify and share its link among your peers and finally do add this project to your resume.