//是否为空 /** * null undefined NaN false " " {} [] 为空 * 为空 true 不为空 false * @param {*} value 参数 * */ isEmpty(value) { let a = false; if (Object.prototype ...
分类:
编程语言 时间:
2020-06-30 17:23:01
阅读次数:
109
数组模拟队列 代码模板 const int N = 1e6 + 10; int q[N], hh = 0, rr = -1; void push(int x) { q[++rr] = x; } void pop() { ++hh; } void isempty() { return hh <= tt ...
分类:
其他好文 时间:
2020-06-25 16:04:50
阅读次数:
49
数组模拟栈 代码模板 const int N = 1e6 + 10; int st[N], tt = -1; void push(int x) { st[++tt] = x; } void pop() { --tt; } bool isempty() { return tt >= 0; } void ...
分类:
其他好文 时间:
2020-06-25 15:46:10
阅读次数:
50
设已知有两个堆栈S1和S2,请用这两个堆栈模拟出一个队列Q。 所谓用堆栈模拟队列,实际上就是通过调用堆栈的下列操作函数: int IsFull(Stack S):判断堆栈S是否已满,返回1或0; int IsEmpty (Stack S ):判断堆栈S是否为空,返回1或0; void Push(St ...
分类:
其他好文 时间:
2020-06-24 19:45:42
阅读次数:
56
题目 栈排序。 编写程序,对栈进行排序使最小元素位于栈顶。最多只能使用一个其他的临时栈存放数据,但不得将元素复制到别的数据结构(如数组)中。该栈支持如下操作:push、pop、peek 和 isEmpty。当栈为空时,peek 返回 -1。 示例1: 输入: ["SortedStack", "pus ...
分类:
编程语言 时间:
2020-06-20 22:06:30
阅读次数:
57
控制结构 Scala的控制结构有:if、while、for、try、match和函数调用。 if表达式 if可以作为一个返回值,如下面的代码。同时用val,就像Java的final变量一样,一旦初始化就不会改变。 val filename = if (!args.isEmpty) args(0) e ...
分类:
其他好文 时间:
2020-06-15 19:21:42
阅读次数:
42
isNull判断property字段是否是null,用isEmpty更方便,包含了null和空字符串 例子一:isEqual相当于equals,数字用得多些,一般都是判断状态值<isEqual property="state" compareValue="0">< /isEqual>或<isEqua ...
分类:
其他好文 时间:
2020-06-14 18:34:39
阅读次数:
66
StringUtils方法的操作对象是java.lang.String类型的对象,是JDK提供的String类型操作方法的补充,并且是null安全的(即如果输入参数String为null则不会抛出NullPointerException,而是做了相应处理,例如,如果输入为null则返回也是null等 ...
分类:
其他好文 时间:
2020-06-09 15:04:30
阅读次数:
69
# 第11周知识总结 标签(空格分隔): 未分类 计算机科学或软件工程的领域对栈与队列的四个操作有特定的名称:栈:push: 加入一个物件,入栈、推入、…;pop: 取出一个物件,出栈、弹出、…;top: 检查一个「特定」的对象,顶部、头部、…,isEmpty: 和检查容器内有没有物件,为空、…。队 ...
分类:
其他好文 时间:
2020-06-04 18:06:22
阅读次数:
93
if (StringUtils.isEmpty(date)) { date = DateUtil.Date2String(new Date(), DateUtil.YYYYMMDD);}StkInnerStockInfoExample example = new StkInnerStockInfoE ...
分类:
其他好文 时间:
2020-05-25 16:11:59
阅读次数:
81