hello-algo/codes/python/chapter_stack_and_queue
malone6 a9d70e9e4b
fix: raise error in peek() function of linkedlist_stack.py, linkedlist_queue.py, linkedlist_deque.py (#754)
* fix: linkedlist_stack.py 中的peek方法需要判空raise Error

栈空的时候不能再 peek() 。另外由于 pop() 复用了 peek() ,栈空时返回的 None 会传递到 pop() 中的 num ,导致后续的继续执行 
 self.peek.next 报错等后续问题

* Update linkedlist_stack.py

* Update linkedlist_queue.py

* Update linkedlist_deque.py

---------

Co-authored-by: Yudong Jin <krahets@163.com>
2023-09-14 01:22:53 +08:00
..
array_deque.py Remove -> None for Python functions 2023-07-24 22:34:05 +08:00
array_queue.py Fine tune. 2023-07-31 03:27:26 +08:00
array_stack.py Remove -> None for Python functions 2023-07-24 22:34:05 +08:00
deque.py Unify the comment style of python codes 2023-04-09 05:30:02 +08:00
linkedlist_deque.py fix: raise error in peek() function of linkedlist_stack.py, linkedlist_queue.py, linkedlist_deque.py (#754) 2023-09-14 01:22:53 +08:00
linkedlist_queue.py fix: raise error in peek() function of linkedlist_stack.py, linkedlist_queue.py, linkedlist_deque.py (#754) 2023-09-14 01:22:53 +08:00
linkedlist_stack.py fix: raise error in peek() function of linkedlist_stack.py, linkedlist_queue.py, linkedlist_deque.py (#754) 2023-09-14 01:22:53 +08:00
queue.py Unify the comment style of python codes 2023-04-09 05:30:02 +08:00
stack.py Unify the comment style of python codes 2023-04-09 05:30:02 +08:00