auto commit
This commit is contained in:
+372
-144
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -40,7 +40,7 @@
|
||||
|
||||
- Vector:和 ArrayList 类似,但它是线程安全的;
|
||||
|
||||
- LinkedList:基于双向循环链表实现,只能顺序访问,但是可以快速地在链表中间插入和删除元素。不仅如此,LinkedList 还可以用作栈、队列和双向队列。
|
||||
- LinkedList:基于双向链表实现,只能顺序访问,但是可以快速地在链表中间插入和删除元素。不仅如此,LinkedList 还可以用作栈、队列和双向队列。
|
||||
|
||||
### 3. Queue
|
||||
|
||||
@@ -212,7 +212,7 @@ private void writeObject(java.io.ObjectOutputStream s)
|
||||
|
||||
### 4. 和 LinkedList 的区别
|
||||
|
||||
- ArrayList 基于动态数组实现,LinkedList 基于双向循环链表实现;
|
||||
- ArrayList 基于动态数组实现,LinkedList 基于双向链表实现;
|
||||
- ArrayList 支持随机访问,LinkedList 不支持;
|
||||
- LinkedList 在任意位置添加删除元素更快。
|
||||
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ java -Xms=1M -Xmx=2M HackTheJava
|
||||
|
||||
和 Java 堆一样不需要连续的内存,并且可以动态扩展,动态扩展失败一样会抛出 OutOfMemoryError 异常。
|
||||
|
||||
对这块区域进行垃圾回收的主要目标是对常量池的回收和对类的卸载,但是一般比较难实现,HotSpot 虚拟机把它当成永久代来进行垃圾回收。
|
||||
对这块区域进行垃圾回收的主要目标是对常量池的回收和对类的卸载,但是一般比较难实现。JDK1.7 之前,HotSpot 虚拟机把它当成永久代来进行垃圾回收,JDK8 之后,取消了永久代,用 metaspace(元数据)区替代。
|
||||
|
||||
## 运行时常量池
|
||||
|
||||
|
||||
@@ -2208,9 +2208,8 @@ Output : [0, 2]
|
||||
|
||||
```java
|
||||
public List<Integer> diffWaysToCompute(String input) {
|
||||
int n = input.length();
|
||||
List<Integer> ways = new ArrayList<>();
|
||||
for (int i = 0; i < n; i++) {
|
||||
for (int i = 0; i < input.length(); i++) {
|
||||
char c = input.charAt(i);
|
||||
if (c == '+' || c == '-' || c == '*') {
|
||||
List<Integer> left = diffWaysToCompute(input.substring(0, i));
|
||||
@@ -2232,9 +2231,10 @@ public List<Integer> diffWaysToCompute(String input) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ways.size() == 0) {
|
||||
|
||||
if (ways.size() == 0)
|
||||
ways.add(Integer.valueOf(input));
|
||||
}
|
||||
|
||||
return ways;
|
||||
}
|
||||
```
|
||||
|
||||
+4
-1
@@ -603,7 +603,10 @@ INSERT 触发器包含一个名为 NEW 的虚拟表。
|
||||
|
||||
```sql
|
||||
CREATE TRIGGER mytrigger AFTER INSERT ON mytable
|
||||
FOR EACH ROW SELECT NEW.col;
|
||||
FOR EACH ROW SELECT NEW.col into @result;
|
||||
|
||||
-- 获取结果
|
||||
SELECT @result;
|
||||
```
|
||||
|
||||
DELETE 触发器包含一个名为 OLD 的虚拟表,并且是只读的。
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 127 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 142 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 47 KiB |
Reference in New Issue
Block a user