Add a chapter of binary tree.
This commit is contained in:
@@ -45,7 +45,7 @@ class ArrayQueue {
|
||||
|
||||
/* 出队 */
|
||||
public int poll() {
|
||||
// 删除头节点
|
||||
// 删除头结点
|
||||
if (isEmpty())
|
||||
throw new EmptyStackException();
|
||||
int num = nums[front];
|
||||
@@ -56,7 +56,7 @@ class ArrayQueue {
|
||||
|
||||
/* 访问队首元素 */
|
||||
public int peek() {
|
||||
// 删除头节点
|
||||
// 删除头结点
|
||||
if (isEmpty())
|
||||
throw new EmptyStackException();
|
||||
return nums[front];
|
||||
|
@@ -29,7 +29,7 @@ class LinkedListQueue {
|
||||
|
||||
/* 出队 */
|
||||
public int poll() {
|
||||
// 删除头节点
|
||||
// 删除头结点
|
||||
return list.removeFirst();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user