|
|
@ -122,8 +122,8 @@ int pop(LinkedListDeque *deque, bool isFront) {
|
|
|
|
if (fNext) {
|
|
|
|
if (fNext) {
|
|
|
|
fNext->prev = NULL;
|
|
|
|
fNext->prev = NULL;
|
|
|
|
deque->front->next = NULL;
|
|
|
|
deque->front->next = NULL;
|
|
|
|
delDoublyListNode(deque->front);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
delDoublyListNode(deque->front);
|
|
|
|
deque->front = fNext; // 更新头节点
|
|
|
|
deque->front = fNext; // 更新头节点
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 队尾出队操作
|
|
|
|
// 队尾出队操作
|
|
|
@ -133,8 +133,8 @@ int pop(LinkedListDeque *deque, bool isFront) {
|
|
|
|
if (rPrev) {
|
|
|
|
if (rPrev) {
|
|
|
|
rPrev->next = NULL;
|
|
|
|
rPrev->next = NULL;
|
|
|
|
deque->rear->prev = NULL;
|
|
|
|
deque->rear->prev = NULL;
|
|
|
|
delDoublyListNode(deque->rear);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
delDoublyListNode(deque->rear);
|
|
|
|
deque->rear = rPrev; // 更新尾节点
|
|
|
|
deque->rear = rPrev; // 更新尾节点
|
|
|
|
}
|
|
|
|
}
|
|
|
|
deque->queSize--; // 更新队列长度
|
|
|
|
deque->queSize--; // 更新队列长度
|
|
|
|