mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 04:31:55 +08:00
Unify the comment style of python codes
This commit is contained in:
@ -75,14 +75,14 @@
|
||||
=== "Python"
|
||||
|
||||
```python title=""
|
||||
""" 类 """
|
||||
class Node:
|
||||
"""类"""
|
||||
def __init__(self, x: int):
|
||||
self.val: int = x # 节点值
|
||||
self.next: Optional[Node] = None # 指向下一节点的指针(引用)
|
||||
|
||||
""" 函数 """
|
||||
def function() -> int:
|
||||
"""函数"""
|
||||
# do something...
|
||||
return 0
|
||||
|
||||
@ -413,13 +413,13 @@
|
||||
# do something
|
||||
return 0
|
||||
|
||||
""" 循环 O(1) """
|
||||
def loop(n: int) -> None:
|
||||
"""循环 O(1)"""
|
||||
for _ in range(n):
|
||||
function()
|
||||
|
||||
""" 递归 O(n) """
|
||||
def recur(n: int) -> int:
|
||||
"""递归 O(n)"""
|
||||
if n == 1: return
|
||||
return recur(n - 1)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user