为了账号安全,请及时绑定邮箱和手机立即绑定

我想了解递归过程?

我想了解递归过程?

长风秋雁 2021-09-28 17:49:09
houses = ["Shaah's house", "Joseph's house", "Kyle's house", "Stan's house"]def deliver_presents_recursively(houses):    # Worker elf doing his work    if len(houses) == 1:        house = houses[0]        print("Delivering presents to", house)    else:        mid = len(houses) // 2        first_half = houses[:mid]        second_half = houses[mid:]        # Divides his work among two elves        deliver_presents_recursively(first_half)        deliver_presents_recursively(second_half)交付呈现_递归(房屋)
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 146 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号