mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-19 07:17:54 +08:00
Update array stack.
This commit is contained in:
@@ -264,7 +264,7 @@ comments: true
|
||||
/* 访问队首元素 */
|
||||
public int peek() {
|
||||
if (size() == 0)
|
||||
throw new IndexOutOfBoundsException();
|
||||
throw new EmptyStackException();
|
||||
return front.val;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user