Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

essential problems?

Name: dasuraga !8GgBtN/zr. 2010-01-06 14:43

What do you guys think are some problems that most all programmers should be able to write in under 5 minutes? For me, I'd guess Hanoi should be an essential one: writing a function Hanoi(char* letters,int number,int to,int from,int temp) to solve the tower of hanoi problem for 3 slots(the letters array has the disc identifiers in decreasing order) You are supplied with the function move_single(char id,int to,int from) that moves the top disc on the to slot to the from slot(assumes it to be possible).

Name: dasuraga !8GgBtN/zr. 2010-01-06 15:40

>>4
solving it for n slots becomes somewhat pointless (you'd probably have to cycle through them wierdly to do it "efficiently"). You can solve an arbitrary height with 3 slots: the point is to see if they can write it out relatively fast.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List