hello-algo/codes/python
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
..
chapter_array_and_linkedlist Remove -> None for Python functions 2023-07-24 22:34:05 +08:00
chapter_backtracking fix preorder_traversal_iii_compact code 2023-09-09 00:51:00 +08:00
chapter_computational_complexity Add comparison between iteration and recursion. 2023-09-12 00:56:59 +08:00
chapter_divide_and_conquer Format C, C++, C#, Go, Java, Python, Rust code. 2023-09-02 23:54:38 +08:00
chapter_dynamic_programming fix climbing_stairs_constraint_dp code 2023-08-31 02:31:58 +08:00
chapter_graph Remove -> None for Python functions 2023-07-24 22:34:05 +08:00
chapter_greedy Fix the content 2023-08-10 11:35:16 +08:00
chapter_hashing Format C, C++, C#, Go, Java, Python, Rust code. 2023-09-02 23:54:38 +08:00
chapter_heap Format C, C++, C#, Go, Java, Python, Rust code. 2023-09-02 23:54:38 +08:00
chapter_searching Polish the chapter 2023-08-20 14:51:39 +08:00
chapter_sorting Format C, C++, C#, Go, Java, Python, Rust code. 2023-09-02 23:54:38 +08:00
chapter_stack_and_queue 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
chapter_tree fix binary_search_tree code 2023-08-31 02:31:31 +08:00
modules Format C, C++, C#, Go, Java, Python, Rust code. 2023-09-02 23:54:38 +08:00
.gitignore Format the Java codes with the Reat Hat extension. 2023-04-14 00:12:10 +08:00