Sorting Algorithms
CSEF · 2011 Mathematics & Software
Overview
Objectives/Goals The objective of this experiment is to find which sorting algorithm is the fastest from five common algorithms. Our hypothesis was that mergesort would be the fastest as it takes advantage of it being easier to sort a short list than a long list and is able to break down the complexities of sorting thousands of numbers into many simple operations of comparing only two numbers. Methods/Materials In order to test our hypothesis, my partner and I created a program in Python that generates a list of 1,000 random integers in no particular order and then measures how fast each algorithm is able to sort that list from least to greatest. Materials include a computer running Windows and Python. Results In our 1,000 tests, the average sorting time for insertion sort was 0.000505785 seconds. The average sorting time for mergesort was 0.004430423 seconds. The average sorting time for heap sort was 0.005519048 seconds. The average sorting time for quicksort was 0.05777026 seconds. The average sorting time for Bubblesort was 0.106378149 seconds. Conclusions/Discussion Insertion sort turned out to be the fastest sorting algorithm. We believe this may be because of the extra time mergesort must have to merge lists.
Summary statement
The project's purpose is to find the fastest sorting algorithm out of five common algorithms.
Help received
CodeCodex was consulted to aid in writing the program. We learned Python from MIT OpenCourseWare.
Competition history
- CSEF 2011
Resources
Related projects
CSEF · 2007
Awesome Algorithms
CSEF · 2002
The Double-Array Sort: A Study of C++ Sorting Methods
CSEF · 2003
The Battle of the Titans: Empirical Comparison of Sorting Algorithm Processing on Major Operating Systems
CSEF · 2003
O(n) Sorting: A New, More Efficient Computer Sorting Algorithm
ISEF · 2014
Parallel Sorting Algorithms in C Using Open Multi-Processing
ISEF · 2017
Genetic Algorithms and Sorting Data
CSEF · 2008
The Efficiency of Prime-Testing Algorithms
CSEF · 2003
The Need for Speed: Testing the Execution Speed of Today's Popular Computer Languages
Closest projects by meaning, across every fair and year in the corpus.
Browse more like this
Source: California Science & Engineering Fair public projects