Skip to content

Commit 639a785

Browse files
committed
解决复杂度震荡
1 parent 9554b78 commit 639a785

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Array/src/Array.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public E remove(int index) {
118118
// 该行可选
119119
data[size] = null; // loitering objects != memory leak
120120

121-
if (size == data.length / 2) {
121+
if (size == data.length / 4 && data.length / 2 != 0) {
122122
resize(data.length / 2);
123123
}
124124

0 commit comments

Comments
 (0)