News for hackers. Stuff that matters.
Re:Lost skills: What today's coders don't know and why it ma... by bostonpete on Friday August 05, 2011 @02:31PM (#2851132)
Easy -- quicksort! :-)
Re:Lost skills: What today's coders don't know and why it ma... by Yeroc on Saturday August 06, 2011 @11:23AM (#2854030)
I'm curious why you'd choose an algorithm that on average takes O(n log n) comparisons with a O(n^2) worst case versus simply iterating O(n)?

Unless there are other requirements I don't see why you'd suggest sorting the elements.

Re:Lost skills: What today's coders don't know and why it ma... by bostonpete on Sunday August 07, 2011 @07:38PM (#2858125)
I certainly wouldn't choose that algorithm. I thought the correct solution was obvious enough that I could joke about it...
Re:Lost skills: What today's coders don't know and why it ma... by Afton on Friday August 05, 2011 @02:36PM (#2851152)
Actually, if their solution is bit luke-warm, I often follow up with 'now find the second greatest int'. Those that don't consider sorting the array go in the big pile. :)