Idea by: Ryan Alameddine, Nolan Costin, Andrew Zerby
Programmed by: Ryan Alameddine
Selected Bio project:
Question: What is the most efficient (in terms of speed) sorting algorithm?
Background: When creating a computer program, you often need to sort a large list of items into a specific order. However, in some applications, such as games or network protocols, memory efficiency and speed is vital to the success of the application. Because of this, various computer scientists and mathematicians have developed a variety of algorithms for sorting sets of data. However, it can be hard to know which ones are actually going to perform better in specific situations, so doing these tests could be very beneficial.
Possible Algorithms:
- Quicksort
- Algorithm Summary:
- Quicksort uses a divide and conquer approach described below:
- Select an element from A[0 : n – 1] to be the pivot.
- Rearrange the elements of A to partition A into a left subarray and a right subarray, such that no element in the left subarray are larger than the pivot and no element in the right subarray is smaller than the pivot.
- Recursively sort the left and the right subarrays.
- Expected Efficiency:
Worst Case |
Average Case |
Best Case |
- Mergesort
- Algorithm Summary:
- Mergesort uses a divide and conquer approach described below:
- Divide the array repeatedly into two halves
- Stop dividing when there is single element left. By definition, single elements are already sorted.
- Continue merging the two already sorted subarrays into sorted subarrays until they are all merged into one sorted array.
- Expected Efficiency:
Worst Case |
Average Case |
Best Case |
- Bubble Sort
- Algorithm Summary:
- This set of instructions repeats until the correct order has been found:
- Mark the first element in the array.
- If marked value is higher than the next value, swap them.
- Move the marker up one.
- Repeat step two until you hit the end of the array.
- If the array is not sorted, go back to step two.
- Expected Efficiency:
Worst Case |
Average Case |
Best Case |
- Insertion Sort
- Algorithm Summary:
- This algorithm works by inserting values into their respective spots in a list
- Move the first value into a new list.
- Check the next value, and search through the new list until you find the spot the value should be inserted.
- Insert the value.
- Repeat step two until the original is empty.
- Expected Efficiency:
Worst Case |
Average Case |
Best Case |
- Heapsort
- Algorithm Summary:
- This algorithm works by creating a heap tree with the data. It then swaps the top and bottom nodes on the tree until the list is sorted.
- Expected Efficiency:
Worst Case |
Average Case |
Best Case |
- Selection sort
- Algorithm Summary:
- Put a “sorted” marker at the beginning of the array.
- Find the lowest value in the array, and swap it with the first value after the sorted marker.
- Move the sorted marker up by one.
- Repeat step two until the marker reaches the end of the array.
- Expected Efficiency:
Worst Case |
Average Case |
Best Case |
Materials: Computer
Procedure summary: Create a C# program in which the computer generates 1000 random numbers between 0 and 1000 inclusive (duplicates are not prohibited). Then, run multiple the test set through multiple sorting algorithms and record time elapsed. The program will then repeat this process 1000 times, and record output data in chart.
Hypothesis: Heapsort and Mergesort will tie for the highest speed efficiency, because their best and worst case performance is O(n log n).
BIO INDEPENDENT PROJECT