摘要: Below contents are generate by ChatGpt: Time complexity is an important metric for measuring algorithm performance, describing the relationship betwee 阅读全文
posted @ 2024-03-28 13:17 million_yh 阅读(5) 评论(0) 推荐(0) 编辑
摘要: def GCD_brute_force(a,b): best = 0 for d in range(1,min(a,b)+1): if (a%d==0 and b%d==0): best = d return best def GCD_divide_loop(a,b): while b!=0: a, 阅读全文
posted @ 2024-03-28 12:44 million_yh 阅读(4) 评论(0) 推荐(0) 编辑
摘要: # 1.Recursion slow def fibonacci_recursion(n): if n <= 1: return n else: return fibonacci_recursion(n-1) + fibonacci_recursion(n-2) # 2.List save ever 阅读全文
posted @ 2024-03-28 12:02 million_yh 阅读(2) 评论(0) 推荐(0) 编辑