mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-09 00:03:11 +08:00
refactor: Follow the PEP 585 Typing standard (#439)
* Follow the PEP 585 Typing standard * Update list.py
This commit is contained in:
@ -4,17 +4,15 @@ Created Time: 2022-11-29
|
||||
Author: Peng Chen (pengchzn@gmail.com)
|
||||
"""
|
||||
|
||||
import sys, os.path as osp
|
||||
sys.path.append(osp.dirname(osp.dirname(osp.abspath(__file__))))
|
||||
from modules import *
|
||||
|
||||
from collections import deque
|
||||
|
||||
""" Driver Code """
|
||||
if __name__ == "__main__":
|
||||
if __name__ == "__main__":
|
||||
|
||||
""" 初始化队列 """
|
||||
# 在 Python 中,我们一般将双向队列类 deque 看作队列使用
|
||||
# 虽然 queue.Queue() 是纯正的队列类,但不太好用
|
||||
que: Deque[int] = collections.deque()
|
||||
que: deque[int] = deque()
|
||||
|
||||
""" 元素入队 """
|
||||
que.append(1)
|
||||
|
Reference in New Issue
Block a user