mirror of
https://github.com/krahets/hello-algo.git
synced 2026-02-12 23:25:44 +08:00
build
This commit is contained in:
@@ -983,7 +983,7 @@ comments: true
|
||||
// 计算尾指针,指向队尾索引 + 1
|
||||
// 通过取余操作,实现 rear 越过数组尾部后回到头部
|
||||
int rear = (front + queSize) % capacity();
|
||||
// 尾结点后添加 num
|
||||
// 将 num 添加至队尾
|
||||
nums[rear] = num;
|
||||
queSize++;
|
||||
}
|
||||
@@ -1063,7 +1063,7 @@ comments: true
|
||||
// 计算队尾指针,指向队尾索引 + 1
|
||||
// 通过取余操作,实现 rear 越过数组尾部后回到头部
|
||||
int rear = (front + queSize) % queCapacity;
|
||||
// 尾结点后添加 num
|
||||
// 将 num 添加至队尾
|
||||
nums[rear] = num;
|
||||
queSize++;
|
||||
}
|
||||
@@ -1123,7 +1123,7 @@ comments: true
|
||||
# 计算尾指针,指向队尾索引 + 1
|
||||
# 通过取余操作,实现 rear 越过数组尾部后回到头部
|
||||
rear = (self.__front + self.__size) % self.capacity()
|
||||
# 尾结点后添加 num
|
||||
# 将 num 添加至队尾
|
||||
self.__nums[rear] = num
|
||||
self.__size += 1
|
||||
|
||||
@@ -1190,7 +1190,7 @@ comments: true
|
||||
// 计算尾指针,指向队尾索引 + 1
|
||||
// 通过取余操作,实现 rear 越过数组尾部后回到头部
|
||||
rear := (q.front + q.queSize) % q.queCapacity
|
||||
// 尾结点后添加 num
|
||||
// 将 num 添加至队尾
|
||||
q.nums[rear] = num
|
||||
q.queSize++
|
||||
}
|
||||
@@ -1260,7 +1260,7 @@ comments: true
|
||||
// 计算尾指针,指向队尾索引 + 1
|
||||
// 通过取余操作,实现 rear 越过数组尾部后回到头部
|
||||
const rear = (this.#front + this.size) % this.capacity;
|
||||
// 尾结点后添加 num
|
||||
// 将 num 添加至队尾
|
||||
this.#nums[rear] = num;
|
||||
this.#queSize++;
|
||||
}
|
||||
@@ -1331,7 +1331,7 @@ comments: true
|
||||
// 计算尾指针,指向队尾索引 + 1
|
||||
// 通过取余操作,实现 rear 越过数组尾部后回到头部
|
||||
const rear = (this.front + this.queSize) % this.capacity;
|
||||
// 尾结点后添加 num
|
||||
// 将 num 添加至队尾
|
||||
this.nums[rear] = num;
|
||||
this.queSize++;
|
||||
}
|
||||
@@ -1415,7 +1415,7 @@ comments: true
|
||||
// 计算尾指针,指向队尾索引 + 1
|
||||
// 通过取余操作,实现 rear 越过数组尾部后回到头部
|
||||
int rear = (front + queSize) % capacity();
|
||||
// 尾结点后添加 num
|
||||
// 将 num 添加至队尾
|
||||
nums[rear] = num;
|
||||
queSize++;
|
||||
}
|
||||
@@ -1490,7 +1490,7 @@ comments: true
|
||||
// 计算尾指针,指向队尾索引 + 1
|
||||
// 通过取余操作,实现 rear 越过数组尾部后回到头部
|
||||
let rear = (front + queSize) % capacity()
|
||||
// 尾结点后添加 num
|
||||
// 将 num 添加至队尾
|
||||
nums[rear] = num
|
||||
queSize += 1
|
||||
}
|
||||
@@ -1581,7 +1581,7 @@ comments: true
|
||||
// 计算尾指针,指向队尾索引 + 1
|
||||
// 通过取余操作,实现 rear 越过数组尾部后回到头部
|
||||
var rear = (self.front + self.queSize) % self.capacity();
|
||||
// 尾结点后添加 num
|
||||
// 将 num 添加至队尾
|
||||
self.nums[rear] = num;
|
||||
self.queSize += 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user