Hi, I'm rather new to programming and have recently been introduced to the topic of asymptotic complexity. What I'm curious about is how to figure out the asymptotic complexity of a sorting method, given the number of elements and the time taken to sort them.
Here is an example of what I mean.
- Time for 'sortArray' to sort sorted array with 400 elements: 4
- Time for 'sortArray' to sort sorted array with 800 elements: 8
- Time for 'sortArray' to sort sorted array with 1600 elements: 16
Time for 'sortArray' to sort sorted array with 3200 elements: 26
Time for 'sortArray' to sort random array with 400 elements: 255
- Time for 'sortArray' to sort random array with 800 elements: 958
- Time for 'sortArray' to sort random array with 1600 elements: 4059
- Time for 'sortArray' to sort random array with 3200 elements: 16585
Any help about how to go about calculating the Big O notation of something like this? Thanks!