摘要:
博客地址:https://www.cnblogs.com/zylyehuo/ 时间复杂度:O(logn) # _*_coding:utf-8_*_ def binary_search(li, val): left = 0 right = len(li) - 1 while left <= right 阅读全文
摘要:
博客地址:https://www.cnblogs.com/zylyehuo/ 时间复杂度:O(n) # _*_coding:utf-8_*_ def linear_search(li, val): for ind, v in enumerate(li): if v == val: return in 阅读全文
摘要:
博客地址:https://www.cnblogs.com/zylyehuo/ # _*_coding:utf-8_*_ def hanoi(n, a, b, c): if n > 0: hanoi(n - 1, a, c, b) print("moving from %s to %s" % (a, 阅读全文