xinyu04

导航

2022年5月28日 #

LeetCode 111 Minimum Depth of Binary Tree BFS

摘要: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文

posted @ 2022-05-28 14:51 Blackzxy 阅读(11) 评论(0) 推荐(0) 编辑

2022年5月26日 #

LeetCode 230 Kth Smallest Element in a BST InOrder DFS中序遍历

摘要: Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree. Soluti 阅读全文

posted @ 2022-05-26 15:19 Blackzxy 阅读(13) 评论(0) 推荐(0) 编辑

2022年5月24日 #

LeetCode 845 Longest Mountain in Array 正向DP+反向DP

摘要: You may recall that an array arr is a mountain array if and only if: arr.length >= 3 There exists some index i (0-indexed) with 0 < i < arr.length - 1 阅读全文

posted @ 2022-05-24 22:30 Blackzxy 阅读(15) 评论(0) 推荐(0) 编辑

LeetCode 1218 Longest Arithmetic Subsequence of Given Difference 哈希表HashMap

摘要: Given an integer array arr and an integer difference, return the length of the longest subsequence in arr which is an arithmetic sequence such that th 阅读全文

posted @ 2022-05-24 00:09 Blackzxy 阅读(10) 评论(0) 推荐(0) 编辑

2022年5月23日 #

Deep Learning Week7 Notes

摘要: 1. Tansposed Convolution Consider 1d convolution with kernel \(k\): \[ \begin{align} y_i &= (x\circledast k)_i\\ &=\sum_a x_{i+a-1}k_a\\ &=\sum_u x_uk 阅读全文

posted @ 2022-05-23 22:56 Blackzxy 阅读(16) 评论(0) 推荐(0) 编辑

LeetCode 1130 Minimum Cost Tree From Leaf Values 思维

摘要: Given an array arr of positive integers, consider all binary trees such that: Each node has either 0 or 2 children; The values of arr correspond to th 阅读全文

posted @ 2022-05-23 17:36 Blackzxy 阅读(22) 评论(0) 推荐(0) 编辑

2022年5月22日 #

LeetCode 1014 Best Sightseeing Pair DP

摘要: You are given an integer array values where values[i] represents the value of the ith sightseeing spot. Two sightseeing spots i and j have a distance 阅读全文

posted @ 2022-05-22 02:32 Blackzxy 阅读(12) 评论(0) 推荐(0) 编辑

2022年5月20日 #

LeetCode 542 01 Matrix 多源BFS

摘要: Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell. The distance between two adjacent cells is 1. Solution 给定一个 $01$ 阅读全文

posted @ 2022-05-20 05:01 Blackzxy 阅读(20) 评论(0) 推荐(0) 编辑

2022年5月19日 #

LeetCode 437 Path Sum III DFS

摘要: Given the root of a binary tree and an integer targetSum, return the number of paths where the sum of the values along the path equals targetSum. The 阅读全文

posted @ 2022-05-19 21:47 Blackzxy 阅读(14) 评论(0) 推荐(0) 编辑

机器学习中的优化 Optimization Chapter 3 Projected Gradient Descent(2)

摘要: 1. Smooth and strongly convex functions: \(O(\log(1/\epsilon))\) steps \(\large\textbf{Theorem 3.5}\): $f:dom(f) \rightarrow \mathbb{R} $ convex and d 阅读全文

posted @ 2022-05-19 19:53 Blackzxy 阅读(43) 评论(0) 推荐(0) 编辑