mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-22 15:53:50 +08:00
build
This commit is contained in:
@ -959,9 +959,9 @@ comments: true
|
||||
/* 基于链表实现的队列 */
|
||||
#[allow(dead_code)]
|
||||
pub struct LinkedListQueue<T> {
|
||||
front: Option<Rc<RefCell<ListNode<T>>>>, // 头节点 front
|
||||
rear: Option<Rc<RefCell<ListNode<T>>>>, // 尾节点 rear
|
||||
que_size: usize, // 队列的长度
|
||||
front: Option<Rc<RefCell<ListNode<T>>>>, // 头节点 front
|
||||
rear: Option<Rc<RefCell<ListNode<T>>>>, // 尾节点 rear
|
||||
que_size: usize, // 队列的长度
|
||||
}
|
||||
|
||||
impl<T: Copy> LinkedListQueue<T> {
|
||||
@ -969,7 +969,7 @@ comments: true
|
||||
Self {
|
||||
front: None,
|
||||
rear: None,
|
||||
que_size: 0,
|
||||
que_size: 0,
|
||||
}
|
||||
}
|
||||
|
||||
@ -1887,10 +1887,10 @@ comments: true
|
||||
```rust title="array_queue.rs"
|
||||
/* 基于环形数组实现的队列 */
|
||||
struct ArrayQueue {
|
||||
nums: Vec<i32>, // 用于存储队列元素的数组
|
||||
front: i32, // 队首指针,指向队首元素
|
||||
que_size: i32, // 队列长度
|
||||
que_capacity: i32, // 队列容量
|
||||
nums: Vec<i32>, // 用于存储队列元素的数组
|
||||
front: i32, // 队首指针,指向队首元素
|
||||
que_size: i32, // 队列长度
|
||||
que_capacity: i32, // 队列容量
|
||||
}
|
||||
|
||||
impl ArrayQueue {
|
||||
|
Reference in New Issue
Block a user