参考: https://blog.csdn.net/dangzhangjing97/article/details/81477192 https://blog.csdn.net/qq_39747794/article/details/84478771?depth_1-utm_source=distr ...
分类:
其他好文 时间:
2020-03-15 09:45:55
阅读次数:
76
创建方式: 方式一:继承Thread. 自定义一个类继承Thread类。 重写Thread的run方法,把自定义线程的任务代码定义在run方法上。 创建Thread子类的对象,并且调用start方法启动一个线程。 java public synchronized void set(String na ...
分类:
编程语言 时间:
2020-03-15 09:36:38
阅读次数:
48
并查集 #include<iostream> #include<string.h> #include<algorithm> #include<cmath> #include<map> #include<string> #include<stdio.h> #include<vector> #inclu ...
分类:
其他好文 时间:
2020-03-15 00:15:07
阅读次数:
61
Stack 这个是Flutter中布局用到的组件,跟Android中FrameLayout很像,都是可以叠加的现实View。 Stack({ Key key, this.alignment = AlignmentDirectional.topStart, this.textDirection, th ...
分类:
其他好文 时间:
2020-03-15 00:09:58
阅读次数:
82
给你一个由 '('、')' 和小写字母组成的字符串 s。 你需要从字符串中删除最少数目的 '(' 或者 ')' (可以删除任意位置的括号),使得剩下的「括号字符串」有效。 请返回任意一个合法字符串。 有效「括号字符串」应当符合以下 任意一条 要求: 空字符串或只包含小写字母的字符串 可以被写作 AB ...
分类:
其他好文 时间:
2020-03-14 23:47:52
阅读次数:
53
题目描述 http://acm.hdu.edu.cn/showproblem.php?pid=1237 代码示例 #include<iostream> #include<stack> #include<string> #include<sstream> using namespace std; in ...
分类:
其他好文 时间:
2020-03-14 22:04:27
阅读次数:
54
Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to tell if a given s ...
分类:
其他好文 时间:
2020-03-14 21:56:52
阅读次数:
69
DFS使用c++中的stack,BFS使用c++中的queue 1 #include <iostream> 2 #define MAX_VERTS 20 3 #include <stack> 4 #include <queue> 5 6 using namespace std; 7 8 class ...
分类:
其他好文 时间:
2020-03-14 20:24:01
阅读次数:
68
以下内容均摘抄自他人博客,正确性有待考察,请以质疑的态度阅读学习,若有错误请留言指正 stl用过哪些容器? Vector:动态数组 List:双向链表 Deque:与vector类似,但支持双端操作。 Set:关联容器 集合,底层红黑树实现。 Map:关联容器 键值对,底层红黑树实现。 Stack: ...
分类:
其他好文 时间:
2020-03-14 19:59:21
阅读次数:
59
155. Min Stack(最小栈) 链接 https://leetcode cn.com/problems/min stack 题目 设计一个支持 push,pop,top 操作,并能在常数时间内检索到最小元素的栈。 push(x) 将元素 x 推入栈中。 pop() 删除栈顶的元素。 top( ...
分类:
其他好文 时间:
2020-03-14 13:12:45
阅读次数:
64