- 博客(4)
- 资源 (1)
- 问答 (1)
- 收藏
- 关注
原创 Python 使用for循环时要注意range的范围(小问题会引出大bug)
直接说个栗子for i in range(1,2): print('ok')能正常输出ok但是改成for i in range(1,1): print('ok')就不输出了小问题注意哦
2019-01-22 15:01:50 4389
原创 python实现二叉树的生成和递归遍历
今日主题:温故而知新。关于树的生成和遍历是好早之前就学习了的知识,最近复习数据结构,重新学习了一遍,发现就是这个简单的知识点帮助我深入理解了递归和对象,(或者是我之前基础太菜了哈哈),好吧,我们来一起复习,一起进步吧~二叉树的生成用的是层次法,实现时,是用一个list来保存节点值,然后按照层次法把这些点一个个加入树中,然后用前序和中序遍历法来遍历,都是递归实现。递归实现千万别想复杂了,举个前序...
2019-01-21 20:34:53 1098
原创 翻转数列python实现,求前n项和,并能输出整个数列
这是刷题时遇到的一道题,题目描述:小Q定义了一种数列称为翻转数列:给定整数n和m, 满足n能被2m整除。对于一串连续递增整数数列1, 2, 3, 4..., 每隔m个符号翻转一次, 最初符号为'-';。例如n = 8, m = 2, 数列就是: -1, -2, +3, +4, -5, -6, +7, +8.而n = 4, m = 1, 数列就是: -1, +2, -3, + 4.小Q现在希...
2019-01-21 19:54:31 4327
原创 时差相关公式python实现
该方法是用于计算两个指标的时序关系的,比如A指标领先或者滞后或者一致于B指标。公式原理如下:x,y分别是两个时间序列,y为基准指标,l为超前或滞后期, 被称为时差或延迟数 (l=0时表示不移动, 表示同步;若表示超前, 则对应的l﹤0;若表示滞后, 则对应的l﹥0) ;n为所取数据的个数;MB表示最大延迟数。 取不同的l值, 分别代表不同的时差, 并计算时差相关系数Rl, 取绝对值最大的R...
2019-01-21 19:06:21 6182 8
C++简单练习.cpp
2015-05-16
TA创建的收藏夹 TA关注的收藏夹
TA关注的人