This commit is contained in:
krahets 2023-06-06 01:55:55 +08:00
parent b9848fc87c
commit e9e4e90342

View file

@ -2499,11 +2499,7 @@ comments: true
return deque->queSize == 0;
}
/* 判断双向队列是否为空 */
bool empty(arrayDeque *deque) {
return deque->queSize == 0;
}
/* 计算环形数组索引 */
int dequeIndex(arrayDeque *deque, int i) {
// 通过取余操作实现数组首尾相连
// 当 i 越过数组尾部时,回到头部