0% found this document useful (0 votes)
3 views3 pages

Algorithm and Design

Uploaded by

karoomlelo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Algorithm and Design

Uploaded by

karoomlelo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Algorithm and Design

1) Insertion Sort
10000 100000 1000000 5000000
Sorted 0.016ms 0.169ms 1.666ms 7.419ms
Reversely Sorted 3.284ms 3537.4ms 352912ms Unkown
Random 18.066ms 176429ms 512592ms Unkown
Nearly Sorted 0.018ms 0.195ms 1.736ms 9.202ms
Scattered Sorted 14.534ms 1813.93ms 472475ms Unkown
Chunks

2) Merge Sort
10000 100000 1000000 5000000
Sorted 2ms 21ms 204ms 1053ms
Reversely Sorted 3ms 21ms 203ms 1062ms
Random 3ms 28ms 276ms 1432ms
Nearly Sorted 3ms 21ms 209ms 1073ms
Scattered Sorted 3ms 25ms 256ms 1326ms
Chunks
3) New Merge Sort
10000 100000 1000000 5000000
Sorted
Reversely Sorted
Random
Nearly Sorted
Scattered Sorted
Chunks

New Merge sort :


- After doing some research I understood that we can only use insertion sort with merge sort
when K is less than 100 else it is not that useful
Note :
- Doctor I couldn’t find an algorithm for insertion sort that takes two parameters only, all of
them took three parameters ( array[], first,last) so I which if u can give me the solution
after you correct this assignment .
Thank you
The Graph above shows that most merge sort and new merge sort are way better than
The insertion when n is getting larger .
Note:
The numbers in the graph is done by getting the average time of every input inserted
In different sorted way .

You might also like