We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6af9dc commit fffc187Copy full SHA for fffc187
1 file changed
codes/rust/chapter_stack_and_queue/linkedlist_deque.rs
@@ -50,11 +50,11 @@ impl<T: Copy> LinkedListDeque<T> {
50
51
/* 判断双向队列是否为空 */
52
pub fn is_empty(&self) -> bool {
53
- return self.size() == 0;
+ return self.que_size == 0;
54
}
55
56
/* 入队操作 */
57
- pub fn push(&mut self, num: T, is_front: bool) {
+ fn push(&mut self, num: T, is_front: bool) {
58
let node = ListNode::new(num);
59
// 队首入队操作
60
if is_front {
@@ -102,7 +102,7 @@ impl<T: Copy> LinkedListDeque<T> {
102
103
104
/* 出队操作 */
105
- pub fn pop(&mut self, is_front: bool) -> Option<T> {
+ fn pop(&mut self, is_front: bool) -> Option<T> {
106
// 若队列为空,直接返回 None
107
if self.is_empty() {
108
return None;
0 commit comments