+ 1

Understand the code

def solve_toh(n_disks); if n_disks == 0; return solve_toh(n_disks-1) move_disk(n_disks-1) solve_toh(n_disks-1)

13th Apr 2019, 5:22 PM
C ++
C ++ - avatar
2 Respuestas
+ 2
It looks like an algorithm for solving tower of hanoi. But it is not the complete code. To understand it you have to learn recursion (self calling function). https://www.sololearn.com/learn/662/?ref=app https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2465/?ref=app
13th Apr 2019, 8:40 PM
Denise Roßberg
Denise Roßberg - avatar
+ 2
Good I'll learn it...
24th Apr 2019, 1:40 PM
C ++
C ++ - avatar