摘要: 堆是一种二叉树结构 大顶堆:任一父节点比子节点大 小顶堆:父节点比任一子节点小 堆的建立过程即使大/小顶堆的构建过程,给定一个数组,首先初始化,再进行堆的调整 建立大顶堆: def buildMaxHeap(arr): length = len(arr) for i in range(length/ 阅读全文
posted @ 2020-08-12 15:18 扁鹊小脑 阅读(165) 评论(0) 推荐(0) 编辑
摘要: # 不考虑重复元素的情况 def permutation(self,arr): res = [] def dfs(arr,s,e): if s==e: res.append(str(arr)) else: for i in range(s,e+1): arr[s],arr[i] = arr[i],a 阅读全文
posted @ 2020-08-05 17:30 扁鹊小脑 阅读(279) 评论(0) 推荐(0) 编辑
摘要: vstack是将向量竖着接起来 hstack是横着接起来 返回类型都是narray(numpy 数组) 阅读全文
posted @ 2019-04-10 10:39 扁鹊小脑 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 生成 requirements.txtpip freeze > requirements.txt安装requirments.txtpip install -r requirements.txt 阅读全文
posted @ 2019-04-05 21:03 扁鹊小脑 阅读(1884) 评论(0) 推荐(1) 编辑
摘要: 郁闷了好久的问题 ,就是每次从pycharm导入了非本地的python程序,如果程序中包含venv环境都会指定这个目录下的python做interperter ,但是总要遇到no module named 。。即缺少某个模块,要想在这个venv下面添加这个模块就用下面的命令 方法一:conda in 阅读全文
posted @ 2019-04-05 20:19 扁鹊小脑 阅读(2402) 评论(0) 推荐(1) 编辑
摘要: mat 将二维数组转换为矩阵 mat.A 将矩阵转换为数组类型(numpy 的narray) 阅读全文
posted @ 2019-04-05 17:26 扁鹊小脑 阅读(422) 评论(0) 推荐(0) 编辑