import java.util.* class Solution { fun minDepth(root: TreeNode?): Int { if (root == null) { return 0 } var depth = 0 //LinkedList实现了Queue接口,可以用作队列使用 ...
分类:
其他好文 时间:
2020-04-16 15:12:48
阅读次数:
56
传送门:https://codeforces.com/contest/1334/problem/D 题意:找到字典序最小的欧拉回路 并输出l到r这一段 一开始又想错了,感觉最近做题都不长脑子 因为是字典序最小所以1放在越前面越好,1又不能跟1连,就连2,在回到1 n=5时带1的就是12131415, ...
分类:
其他好文 时间:
2020-04-12 10:35:46
阅读次数:
89
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) Push element x onto stack. pop() Removes the ...
分类:
其他好文 时间:
2020-04-11 10:05:56
阅读次数:
82
peaks 介绍 peaks() 函数本质上是一个二元高斯分布的PDF; 从图像上看,它有3个极小点,3个极大点; .jpg) 应用举例 代码 最终的效果图: ...
分类:
其他好文 时间:
2020-04-08 21:01:28
阅读次数:
119
题意: 给定一个序列,可以把左边任意长度为$i$的连续序列移动到最右边(不改变连续序列的顺序)。如: 原序列为:$a_1,a_2,a_3,...,a_i,a_{i+1},...,a_{n-1},a_n$ 移动后的序列为:$a_{i+1},a_{i+2},...,a_{n-1},a_n,a_1,a_2 ...
分类:
其他好文 时间:
2020-04-06 13:51:32
阅读次数:
48
leeetcode 33. Search in Rotated Sorted Array leetcode 81 leetcode 153. Find Minimum in Rotated Sorted Array 这几道的相似处是:都是部分有序的数组,可以用二分搜索来做。最重要的是判断到底是左区间 ...
分类:
其他好文 时间:
2020-04-04 09:16:41
阅读次数:
75
https://leetcode cn.com/problems/minimum number of flips to convert binary matrix to zero matrix/ DFS ...
分类:
其他好文 时间:
2020-04-02 22:23:49
阅读次数:
83
题意:在二叉查找树中查找两个节点之差的最小绝对值 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x ...
分类:
其他好文 时间:
2020-04-01 00:56:06
阅读次数:
75
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Remov ...
分类:
其他好文 时间:
2020-03-31 22:46:01
阅读次数:
62
题目描述 Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2. You have the following 3 operations pe ...
分类:
其他好文 时间:
2020-03-31 18:48:00
阅读次数:
81