Update array stack.

This commit is contained in:
Yudong Jin
2022-12-20 14:13:21 +08:00
parent fe7564d54d
commit fa3eff81d1
9 changed files with 46 additions and 43 deletions

View File

@@ -264,7 +264,7 @@ comments: true
/* 访问队首元素 */
public int peek() {
if (size() == 0)
throw new IndexOutOfBoundsException();
throw new EmptyStackException();
return front.val;
}
}