Update code style for Python

This commit is contained in:
krahets
2023-03-03 03:07:22 +08:00
parent 7e9e6b000c
commit 7c501140f0
45 changed files with 274 additions and 266 deletions
+2 -1
View File
@@ -6,7 +6,7 @@ Author: Krahets (krahets@163.com)
import sys, os.path as osp
sys.path.append(osp.dirname(osp.dirname(osp.abspath(__file__))))
from include import *
from modules import *
def test_push(heap, val, flag=1):
heapq.heappush(heap, flag * val) # 元素入堆
@@ -18,6 +18,7 @@ def test_pop(heap, flag=1):
print(f"\n堆顶元素 {val} 出堆后")
print_heap([flag * val for val in heap])
""" Driver Code """
if __name__ == "__main__":
# 初始化小顶堆
min_heap, flag = [], 1