Algorithm Simulation Application
Hi Friends...... :)
Today I'm going to share my 2nd year 1st semester project with you, an algorithm simulation Application. As we all know simulator is a substitution of something, which will do the same functionalities with less performance or with less features but won't omit the important functionalities. This algorithm simulator will handle 2 algorithms, Selection sort and Bubble sort. So let's start the game.
Algorithm Simulator is an application created for the users who are new to algorithm and sorting. When it comes to algorithm there are so many algorithms such as insertion, selection, bubble, heap, quick sort etc. In this application, selection sort and bubble sort have been demonstrated with the aid of animation, dry run and pseudo code. The user will get a basic yet clear idea of selection sort and bubble sort.
1. Selection Sort
Selection sorting is conceptually the simplest sorting algorithm. This algorithm first finds the smallest element in the array and exchanges it with the element in the first position, then finds the second smallest element and exchange it with the element in the second position, and continues in this way until the entire array is sorted.
Complexity of Selection sort
Worst case time complexity: O (n^2)
Best case time complexity: O (n^2)
2. Bubble Sort
Bubble Sort is an algorithm which is used to sort N elements that are given in a memory for example an array with N number of elements. Bubble Sort compares the entire element one by one and sort them based on their values. It is called Bubble sort, because with each iteration the smaller element in the list bubbles up towards the first place, just like a water bubble rises up to the water surface. Sorting takes place by stepping through all the data items one-by-one in pairs and comparing adjacent data items and swapping each pair that is out of order.
The application is built using visual studio 2013 in C#. Lets take a look at the application process.
Step 01 : Run the app.
2. Bubble Sort
Bubble Sort is an algorithm which is used to sort N elements that are given in a memory for example an array with N number of elements. Bubble Sort compares the entire element one by one and sort them based on their values. It is called Bubble sort, because with each iteration the smaller element in the list bubbles up towards the first place, just like a water bubble rises up to the water surface. Sorting takes place by stepping through all the data items one-by-one in pairs and comparing adjacent data items and swapping each pair that is out of order.
Complexity of Bubble sort
Worst case time complexity: O (n^2)
Best case time complexity: O (n)
The application is built using visual studio 2013 in C#. Lets take a look at the application process.
Step 01 : Run the app.
Fig 1 : Run the app
Step 02 : Click on Generate Numbers button to get random numbers for sorting.
Fig 2 : Generate numbers
Step 03 : Select the algorithm type in which you want to sort the randomly generated numbers. Also provide the sorting order, ascending or descending. Click on Sort array. You'll get the final output as sorted array.
Fig 3 : Selection of algorithm and sorting order
Step 04 : Click on simulate button to see the simulation of the algorithm.
Fig 4 : Simulation of the algorithm
Step 05 : Pop-up window will prompt saying that the sorting is completed.
Fig 5 : Sorting completed
Step 06 : Click on Dry run button to see the algorithm pseudo code and the dry run.
Fig 6 : Pseudo code of the sorting algorithm
Comments
Post a Comment