mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-06 22:34:18 +08:00
Remove -> None
for Python functions
This commit is contained in:
@ -12,13 +12,13 @@ from modules import *
|
||||
import heapq
|
||||
|
||||
|
||||
def test_push(heap: list, val: int, flag: int = 1) -> None:
|
||||
def test_push(heap: list, val: int, flag: int = 1):
|
||||
heapq.heappush(heap, flag * val) # 元素入堆
|
||||
print(f"\n元素 {val} 入堆后")
|
||||
print_heap([flag * val for val in heap])
|
||||
|
||||
|
||||
def test_pop(heap: list, flag: int = 1) -> None:
|
||||
def test_pop(heap: list, flag: int = 1):
|
||||
val = flag * heapq.heappop(heap) # 堆顶元素出堆
|
||||
print(f"\n堆顶元素 {val} 出堆后")
|
||||
print_heap([flag * val for val in heap])
|
||||
|
Reference in New Issue
Block a user