Why do we need sorting algorithms | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Why do we need sorting algorithms

a lot of emphasis is placed on sorting algorithms although, I still wondering why it is needed as most languages provide a function or method to sort a list of arrays

27th Dec 2017, 3:46 PM
olufemi jolugbo
olufemi jolugbo - avatar
5 Answers
+ 4
take for example your desk. if everything on your desk would be messy (unsorted), your work speed will decrease a lot and it will be hard to locate some items. but if everything is on the right place your job is much easier.
27th Dec 2017, 4:03 PM
Roabs
Roabs - avatar
+ 4
that's a good point. i think if language has some sorting functions then yeah, it's better to use them to save time and fingers. but it's still good to know how sorting algorithm works, what type of sorting algorithms we have etc.
27th Dec 2017, 4:20 PM
Roabs
Roabs - avatar
+ 3
I'll add my penny. Sorting problem is very good practical and well defined problem to polish developer skills. Numeric array in RAM sorting is very simple case. What if - array doesn't fit in memory - distributed across multiple locations - ordering criteria hard to calculate - huge array is 'partially' ordered - etc. This is really Pandora box...
28th Dec 2017, 8:07 AM
Andrey Smirnov
Andrey Smirnov - avatar
+ 2
that's a fair answer @Roabs but don't you think a lot of languages provide sorting functions on all there list variables like arrays and maps, so why reinvent the wheel
27th Dec 2017, 4:06 PM
olufemi jolugbo
olufemi jolugbo - avatar
+ 1
what do you think how these provided sorting functions/methods sorts your data? by magic? no it uses these sorting algorithms.
28th Dec 2017, 6:14 AM
Jeremy
Jeremy - avatar