摘要: def quick_sort(array, left, right): if left >= right: return low = left high = right key = array[low] while left < right: while left < right and array 阅读全文
posted @ 2020-10-22 14:44 威威后花园 阅读(122) 评论(0) 推荐(0)
摘要: # 求根号2 def solution(): # 初始化x x = 2 # 目标函数fx fx = x**2 - 2 # 优化求解fx while fx > 0.001: x = x - (fx * 1.0 / (2*x)) fx = x**2 - 2 return x 1. 使用牛顿迭代法,关键代 阅读全文
posted @ 2020-10-22 09:37 威威后花园 阅读(429) 评论(0) 推荐(0)