Timeline for How important is it for a programmer to know how to implement a QuickSort/MergeSort algorithm from memory?
Current License: CC BY-SA 3.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 16, 2020 at 10:01 | history | edited | CommunityBot |
Commonmark migration
|
|
Dec 18, 2016 at 17:40 | history | edited | Aaron Hall | CC BY-SA 3.0 |
added 31 characters in body
|
Feb 4, 2013 at 5:00 | comment | added | Zachary K | In truth 99.999% of the time when you need a sort just using the library that comes with your language or runtime will be the correct choice. | |
Nov 6, 2012 at 17:47 | comment | added | Peter Rowell |
@mattnz: A somewhat belated followup to your "O() sizing". One thing I learned the hard way was that with a large dataset bad locality of reference can completely overwhelm the O(). You may have an algo that is O(n log n) , but if you get a lot of cache misses or (God forbid) you hit the disk, then that n log n will be but a fond memory.
|
|
Oct 11, 2012 at 19:55 | comment | added | mattnz | @Larry: I think I have forgotten more than many programmers know about details of algorithms- and Quick sort from scratch is one of them - for a very good reason - I have chosen to read up on high level things and use high level languages rather than stay down in bowls of low level implementation detail. Frankly - I don't care what sort the library routine I am using uses - it can use pixy dust and fairies as far as I am concerned. The Docs will tell the O() for sizing- that is all I need to know. | |
Oct 9, 2012 at 20:09 | comment | added | Larry Gritz | To think that the goal is to memorize quicksort is to miss the point of the question. Of course, in the real world, if you needed a generic quicksort, you'd use the library routine or look up the code and copy it. The test is to see if you understand recursion, loop invariants, etc., and asking you to quickly jot down a sort algorithm is just a really simple demonstration of that knowledge. If you aren't capable of re-deriving a 20-line quicksort on the spot, how many things are you routinely doing really inefficiently or incorrectly without even knowing it? | |
Oct 7, 2012 at 18:47 | history | edited | yannis | CC BY-SA 3.0 |
added 377 characters in body
|
Oct 7, 2012 at 17:13 | comment | added | Peter Rowell | @KonradRudolph -- he asked, "how many of you have a programming position where it actually is essential that you can remember or come up with this kind of stuff on your own?" My response was perhaps a bit oblique. Once you've made a good survey of the essential algorithms in any particular discipline (sort, search, whatever), you can then forget about the implementation details until you actually need the algo, in which case you go look it up or use a preexisting lib. 25 years ago I built a major search system using B*-trees, but today I would need to RTFM in order to use them well. | |
Oct 7, 2012 at 15:08 | comment | added | Konrad Rudolph | How does that answer the question? He said “I don’t need to know everything”, he did not say “I don’t need to know anything”. Some skills are fundamental, and the whole question was about whether a particular piece of information belonged to the category of fundamental skills or not. | |
Oct 7, 2012 at 12:27 | vote | accept | John Smith | ||
Oct 7, 2012 at 11:01 | comment | added | Wok | This citation is dubious: I am "unable to find any substantive evidence connecting the saying to Einstein". | |
Oct 7, 2012 at 9:08 | comment | added | zaadeh | The fact is if human beings were not able to build upon previous buildings (whether by them selves or others), we wouldn't be here now. It's generally good to know where to find stuff and how we did get here, but trying constantly to memorize Everything will just make us useless. having to know everything is why there are so many people in the world. I think, if you are getting a job done, you're great as you are. | |
Oct 7, 2012 at 2:21 | history | answered | Peter Rowell | CC BY-SA 3.0 |