Question
In this assignment you will compare the real-time performance of the built-in sort function in the STL and your implementation of the bubble sort algorithm.
In this assignment you will compare the real-time performance of the built-in sort function in the STL and your implementation of the bubble sort algorithm. First, generate an array of 1000 random numbers from 1 to 10000. Sort the array with your bubble sort function and time the sort. Then generate a new set of 1000 numbers and sort using the STL sort function, timing its performance. What are the differences in times to sort? Now increase the array size to 10000 and time both sorts. What are the differences? Now increase the array size to 100000, sort both ways, and compare. At what point did the two algorithms begin to diverge in time to sort? If they hadn't diverged by 100000 elements, continue increasing the size of the array until the two sorts do diverge and report on the size of the array and compare the sorting times. (Jupyter Notebook) keep it simple
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started