DEV Community

Discussion on: Algorithms Every Programmer Should Know 2

Collapse
 
trueneu profile image
Pavel Gurkov

Would you mind to elaborate on why you're suggesting using quicksort on a small dataset?
Also, an article on algorithms without complexity analysis doesn't feel complete.
Also, as pointed out by @paddy3118 , you leave stability out of scope.
Also, it's strange that you recommend using heapsort "When to find the smallest or larger item in the list". That's a linear task.

Collapse
 
nemanajay profile image
Ajay Neman

Yes ... @pavel Gurkov you are very correct . Becoz every algorithm is having some time and space complexity.
As per my knowledge quick sort and merge sort both are very time efficient than any sorting algo. With the time complexity of O(nlogn) . while the other sorting algo. like selection sort, insertion sort and bubble sort takes O(n²) time.
Here n is the number of items.
You can find the code for above sorting algo. in below repo that I have prepared.
github.com/AjayNeman45/Sorting-Algo

Collapse
 
trueneu profile image
Pavel Gurkov

Thank you for your reply Ajay,
but you kinda got me wrong.
I was trying to point out that the contents of the article are incomplete; pros and cons are just statements without any proof and some of them are, actually, wrong.
Given that the article has 69 bookmarks, it worries me.