mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-16 03:59:18 +08:00
@@ -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