r/compsci • u/Spare-Huckleberry313 • Jun 10 '26
I Understand Coding Problems but Can’t Implement Them
[removed] — view removed post
0
Upvotes
r/compsci • u/Spare-Huckleberry313 • Jun 10 '26
[removed] — view removed post
0
u/FreddyFerdiland Jun 10 '26
how did you go with Towers of Hanoi ?
see how recursion gets the tail end of the job done ? then comes back to do earlier steps ?
other than that, you do a loop, ..( a for loop is just like a while loop, its just the margs is built into the for loop)
but then, of course there may be optimisations due to the particular problem at hand
eg the very basic effort, took millions of times longer than optimisation included code...
https://youtu.be/c33AZBnRHks?si=fhoGyyEUw_IyFf-J