Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Afton
on Aug 5, 2011
|
parent
|
context
|
favorite
| on:
Lost skills: What today's coders don't know and wh...
I've resorted to starting with "find the greatest int in an array of ints". And yes, I'm routinely disappointed.
bostonpete
on Aug 5, 2011
[–]
Easy -- quicksort! :-)
Yeroc
on Aug 6, 2011
|
parent
|
next
[–]
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.
bostonpete
on Aug 7, 2011
|
root
|
parent
|
next
[–]
I certainly wouldn't choose that algorithm. I thought the correct solution was obvious enough that I could joke about it...
Afton
on Aug 5, 2011
|
parent
|
prev
[–]
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. :)
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: