自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(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

(SavingsAccount Class) Create a SavingsAccount class. Use a static data member annualInterestRate to store the annual interest rate for each of the savers. Each member of the class contains a private data member savingsBalance indicating the amount the saver currently has on deposit. Provide member function calculateMonthlyInterest that calculates the monthly interest by multiplying the balance by annualInterestRate divided by 12; this interest should be added to savingsBalance. Provide a static member function modifyInterestRate that sets the static annualInterestRate to a new value. Write a driver program to test class SavingsAccount. Instantiate two different objects of class SavingsAccount, saver1 and saver2, with balances of $2000.00 and $3000.00, respectively. Set the annualInterestRate to 3 percent. Then calculate the monthly interest and print the new balances for each of the savers. Then set the annualInterestRate to 4 percent, calculate the next month’s interest and print the new balances for each of the savers. --------------------------------------------------------------------------------

2015-05-16

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除