Skip to content

F74046080/lab3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I used g++ to compile this program.

sort(): 0 seconds
insertion_sort(): 0.01 seconds
sort(): 0 seconds
insertion_sort(): 1.31 seconds
sort(): 0.05 seconds
insertion_sort(): 128 seconds
sort(): 0.53 seconds
insertion_sort(): 12817 seconds

If the vector of sorted numbers is bigger, the result of the time of sort is obviously different between n^2 and n*log(n).
The result of n^2 and n*log(n) should differ n/logn. In my program, the 1000000 random numbers in two sorts differ 24183 times. In principal, they should be differ 166666 times. I think that the  n^2 and n*log(n) are the wost results but the results are great disparity.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published