- 博客(2)
- 收藏
- 关注
原创 python :赋值、深拷贝、浅拷贝的区别
昨天在Leetcode上遇见一道有关回溯算法的题目遇见了这个问题:在3处将得到的答案append到1处的res中
2020-09-09 18:04:52 127
原创 快速幂:迭代法和递归法 python实现
迭代法def quick_power(x, n): res = 1 while n > 0: # 如果幂为奇数, 把x记录下来,储存在res中 if n % 2 == 1: res *= x # 如果幂为偶数 则不记录,只是处理x, n x *= x n >>= 1 return res递归法:def quick_power(x, n):
2020-09-01 17:43:16 325
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人