Lab01_WriteUp

Question 1 Question 1a Write a function summation that evaluates the following summation for $n \geq 1$: $$\sum_{i=1}^{n} i^3 + 3 i^2$$ 1 2 3 4 def summation(n): """Compute the summation i^3 + 3 * i^2 for 1 <= i <= n.""" ... return sum(i**3+3*i**2 for i in range(1,n+1)) Question 1b Write a function elementwise_list_sum that computes the square of each value in list_1, the cube of each value in list_2, then returns a list containing the element-wise sum of these results.

ML for Finance in Python

Description Preparing data and a linear model Machine learning tree methods Neural networks and KNN Machine learning with modern portfolio theory 这门课是基于DataCamp, 其实前面很大一部分都是在介绍python中的一些科学工具包: Numpy Pandas Matplotlib Seaborn

二叉树

二叉树 前序遍历 根节点-> 左孩子-> 右孩子 中序遍历 左孩子-> 根节点-> 右孩子 后序遍历 左孩子->右孩子-> 根

从尾到头打印链表

从尾到头打印链表 输入一个链表的头节点,从尾到头反过来返回每个节点的值(用数组返回)。 示例1 1 2 **输入** head = [1,3,2] **输出** [2,3,1] 限制 0 <= 链表长

动态规划

动态规划 若确定给定问题具有重叠子问题和最优子结构,那么就可以使用动态规划求解。总体上看,求解可分为四步 状态定义: 构建问题最优解模型,包括问题