Merge pull request #133 from tao363/master

Update array stack
This commit is contained in:
Yudong Jin
2022-12-20 14:14:44 +08:00
committed by GitHub
9 changed files with 46 additions and 34 deletions

View File

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