2020年7月25日
摘要: 快速排序 才发现自己配置好差,最坏情况10000就堆栈溢出了。。。。。 # coding: utf-8 import random import sys sys.setrecursionlimit(100000000) def quick_sort(li, left, right): if left 阅读全文
posted @ 2020-07-25 20:29 Bethuel 阅读(83) 评论(0) 推荐(0)
摘要: 跟随视频学习了一些常见的排序,把自己第二天能理解的记录下来,万一以后忘记了呢? def linear_search(li, target): """ 线性查找 """ for ind, tar in enumerate(li): if tar == target: return ind else: 阅读全文
posted @ 2020-07-25 18:40 Bethuel 阅读(97) 评论(0) 推荐(0)
  2020年7月24日
摘要: 汉诺塔应用到了最简单的迭代,最基本的代码如下: def hannoi(n, a, c, b, step): if n != 0: hannoi(n - 1, a, b, c, step) print("Moving form %s to %s" % (a, b)) hannoi(n - 1, c, 阅读全文
posted @ 2020-07-24 08:21 Bethuel 阅读(136) 评论(0) 推荐(0)
  2020年4月15日
摘要: 在pycharn中运行时,选择Run则运行不成功,选择Debug则有概率运行成功,看到有人说是因为多线程问题,Run时程序未运行完成导致,暂且记下,以供后时回顾。 from selenium.webdriver import ActionChains from selenium.webdriver. 阅读全文
posted @ 2020-04-15 15:48 Bethuel 阅读(58) 评论(0) 推荐(0)