It's UWAweek 17 (1st semester, week 8)

help2200

This forum is provided to promote discussion amongst students enrolled in CITS2200 Data Structures and Algorithms.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying the 4 articles in this topic
Showing 4 of 97 articles.
Currently 65 other people reading this forum.


 UWA week 12 (1st semester, week 4) ↓
SVG not supported

Login to reply

👍x1
helpful
11:17pm Thu 21st Mar, ANONYMOUS

Amitava mentioned in the lecture that insertion sort is faster than merge sort up until 6000 elements. However, the graph of both algorithms show that the intercept is much smaller, and insertion sort is only faster for less than 100 elements approximately. As such, what is the correct approximate input size for which insertion sort is faster than merge sort so that I may decide which to implement. Thanks.


SVG not supported

Login to reply

👍?
helpful
5:03pm Sat 23rd Mar, ANONYMOUS

I was thinking about this myself, but computers are so fast that for sorting sub 100 elements it makes hardly any practical difference, so I went with merge sort only. Also, different sources on the internet say different numbers of `n` items are the equilibrium; I have seen n stated as 55, 38, 100 etc. I came across this link in my research which was quite informative: https://w3.cs.jmu.edu/lam2mo/cs240_2014_08/pa04-sorting.html#:~:text=Switching%20Strategies&text=As%20you%20can%20see%2C%20binary,faster%20for%20all%20larger%20inputs. Although I could be entirely wrong so if someone more knowledgable replies feel free to ignore this :)


 UWA week 13 (1st semester, week 5) ↓
SVG not supported

Login to reply

👍?
helpful
2:15pm Mon 25th Mar, Amitava D.

ANONYMOUS wrote:
> Amitava mentioned in the lecture that insertion sort is faster than merge sort up until 6000 elements. However, the graph of both algorithms show that the intercept is much smaller, and insertion sort is only faster for less than 100 elements approximately. As such, what is the correct approximate input size for which insertion sort is faster than merge sort so that I may decide which to implement. > > Thanks.
I also said on a particular machine this was the case.


SVG not supported

Login to reply

👍?
helpful
2:17pm Mon 25th Mar, Amitava D.

ANONYMOUS wrote:
> I was thinking about this myself, but computers are so fast that for sorting sub 100 elements it makes hardly any practical difference, so I went with merge sort only. Also, different sources on the internet say different numbers of `n` items are the equilibrium; I have seen n stated as 55, 38, 100 etc. > > I came across this link in my research which was quite informative: https://w3.cs.jmu.edu/lam2mo/cs240_2014_08/pa04-sorting.html#:~:text=Switching%20Strategies&text=As%20you%20can%20see%2C%20binary,faster%20for%20all%20larger%20inputs. > > Although I could be entirely wrong so if someone more knowledgable replies feel free to ignore this :)
Actual runtime is not tested in this unit. And runtimes vary depending on the language and machine.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  5:07AM Sep 06 2023
Privacy policy