Skip to content

Commit fffc187

Browse files
committed
Update linkedlist deque
1 parent d6af9dc commit fffc187

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

codes/rust/chapter_stack_and_queue/linkedlist_deque.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ impl<T: Copy> LinkedListDeque<T> {
5050

5151
/* 判断双向队列是否为空 */
5252
pub fn is_empty(&self) -> bool {
53-
return self.size() == 0;
53+
return self.que_size == 0;
5454
}
5555

5656
/* 入队操作 */
57-
pub fn push(&mut self, num: T, is_front: bool) {
57+
fn push(&mut self, num: T, is_front: bool) {
5858
let node = ListNode::new(num);
5959
// 队首入队操作
6060
if is_front {
@@ -102,7 +102,7 @@ impl<T: Copy> LinkedListDeque<T> {
102102
}
103103

104104
/* 出队操作 */
105-
pub fn pop(&mut self, is_front: bool) -> Option<T> {
105+
fn pop(&mut self, is_front: bool) -> Option<T> {
106106
// 若队列为空,直接返回 None
107107
if self.is_empty() {
108108
return None;

0 commit comments

Comments
 (0)