陆公子521

关注

bx01_hanoi_recursion

陆公子521

关注

阅读 80

2022-02-10

def hanoi(n, a, b, c):

    if n > 0:
        hanoi(n - 1, a, c, b)
        print(f'moving from {a} to {c}')
        hanoi(n-1, b, a, c)


hanoi(3, 'A', 'B', 'C')

相关推荐

7dcac6528821

The Towers of Hanoi recursion 汉诺塔 C++

7dcac6528821 151 0 0

止止_8fc8

Hanoi双塔问题(hanoi)

止止_8fc8 194 0 0

想溜了的蜗牛

递归Recursion讲解

想溜了的蜗牛 33 0 0

pipu

GO+ 递归(Recursion)

pipu 44 0 0

RIOChing

bx05_insert_sort

RIOChing 110 0 0

青乌

bx04_select_sort

青乌 115 0 0

是她丫

bx03_bubble_sort

是她丫 94 0 0

陆公子521

0 4 递归(Recursion)

陆公子521 77 0 0

他说Python

recursion depth exceeded” error

他说Python 13 0 0

WikongGuan

递归Recursion总结_python

WikongGuan 68 0 0

精彩评论(0)

0 0 举报