|
|
|
|
|
by _tef
5675 days ago
|
|
It is like fizzbuzz/binary search in that most people think they can write it and they get it wrong. Quicksort requires careful selection of pivots, and is unstable. (Many scripting languages (perl, python) are opting
for stable sorts) Check out Bentley&McIllroy's Engineering Quick Sort for a guide about the problems implementing a production ready quicksort. If you're going to teach them something easy, simple and relatively hard to implement badly, teach them merge sort. Then teach them adaptive merge sort. |
|
1) how to write a program that guesses a number you thought of by doing binary search.
2) solve 2-queens
3) solve n-queens
4) solve knapsacking or some other combinatorial problem requiring memoization or DP. Of course, I wouldn't tell them any of those buzzwords that are meant to scare them away from just hacking on it.
Their mind will be blown regardless of the language they used and they'll get a feel for O() without even opening Cormen.