摘要: 重点:: 观察到:在带入函数之后,没有任何返回值,是直接对参数本身进行作用。遇到这种情况就必须在基线条件下多加一个 【return】语句 why? 其实就是人为两种情况,第一种就是t是节点,此时只需要将节点平方就可以了。第二种情况就是有分支,首先呢就将root平方,再将分支进行处理。 1 def l 阅读全文
posted @ 2023-04-10 15:35 哎呦_不想学习哟~ 阅读(76) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; int f(int** r, int ** s){ int temp= **r; int temp2=**s; int * z=*r; *r=*s; *s=z; printf("**r= %d\n",**r); prin 阅读全文
posted @ 2023-04-08 11:09 哎呦_不想学习哟~ 阅读(21) 评论(0) 推荐(0)
摘要: 题目:about generator Write the generator function make_generators_generator, which takes a zero-argument generator function g and returns a generator th 阅读全文
posted @ 2023-04-06 19:55 哎呦_不想学习哟~ 阅读(74) 评论(0) 推荐(0)
摘要: def close(n, smallest=10, d=10): """ A sequence is near increasing if each element but the last two is smaller than all elements following its subsequ 阅读全文
posted @ 2023-04-05 15:43 哎呦_不想学习哟~ 阅读(87) 评论(0) 推荐(0)
摘要: pre_old_time: /*** 然后按下enter按键,就可以用n来跳转 N回跳 编辑模式下 输入 【 :noh 】 可以取消高亮 从当前行开始进入编辑模式 vim f命令可以定位到指定字符,;右重复,,向左重复 移动到前一个单词的末尾:ge d0:删除当前位置到行开头的所有内容,不会删除光标 阅读全文
posted @ 2023-04-04 21:00 哎呦_不想学习哟~ 阅读(89) 评论(0) 推荐(0)
摘要: Problem 2 题目描述: 代码: 1 def inc_subseqs(s): 2 """Assuming that S is a list, return a nested list of all subsequences 3 of S (a list of lists) for which 阅读全文
posted @ 2023-04-03 16:54 哎呦_不想学习哟~ 阅读(55) 评论(0) 推荐(0)
摘要: Problem 6 题目描述: 注意事项: 1.不能使用for while循环 2.达到limit时,必须立即返回,不能继续递归 代码: 1.我的代码,很繁琐 1 def shifty_shifts(start, goal, limit): 2 """A diff function for auto 阅读全文
posted @ 2023-03-28 21:56 哎呦_不想学习哟~ 阅读(116) 评论(0) 推荐(0)
摘要: Q6 题目描述: Write a function has_path that takes in a tree t and a string phrase. It returns True if there is a path that starts from the root where the 阅读全文
posted @ 2023-03-25 21:11 哎呦_不想学习哟~ 阅读(60) 评论(0) 推荐(0)
摘要: 1. >>> odds = [1, 3, 5, 7, 9] >>> [x+1 for x in odds] [2, 4, 6, 8, 10] 2. >>> [x for x in odds if 25 % x == 0] [1, 5] 3 >>> digits = [1, 8, 2, 8] >>>[ 阅读全文
posted @ 2023-03-21 19:57 哎呦_不想学习哟~ 阅读(39) 评论(0) 推荐(0)
摘要: Q1 题目描述: 代码实现: 1 def coords(fn, seq, lower, upper): 2 """ 3 >>> seq = [-4, -2, 0, 1, 3] 4 >>> fn = lambda x: x**2 5 >>> coords(fn, seq, 1, 9) 6 [[-2, 阅读全文
posted @ 2023-02-19 20:47 哎呦_不想学习哟~ 阅读(105) 评论(0) 推荐(0)