mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-06 14:27:26 +08:00
Fix a comment in my_list.xx
This commit is contained in:
@ -73,7 +73,7 @@ class MyList:
|
||||
|
||||
def extend_capacity(self) -> None:
|
||||
"""列表扩容"""
|
||||
# 新建一个长度为 self.__size 的数组,并将原数组拷贝到新数组
|
||||
# 新建一个长度为原数组 __extend_ratio 倍的新数组,并将原数组拷贝到新数组
|
||||
self.__nums = self.__nums + [0] * self.capacity() * (self.__extend_ratio - 1)
|
||||
# 更新列表容量
|
||||
self.__capacity = len(self.__nums)
|
||||
|
Reference in New Issue
Block a user