Add Go codes to docs, including

the chapter of stack and queue, the chapter of tree.
This commit is contained in:
Yudong Jin
2022-12-03 20:25:24 +08:00
parent 1d9a076cdd
commit ebf9024136
41 changed files with 898 additions and 486 deletions

View File

@@ -33,7 +33,7 @@ if __name__ == "__main__":
list.append(2)
list.append(5)
list.append(4)
print("添加元素后 list = ", list)
print("添加元素后 list =", list)
""" 中间插入元素 """
list.insert(3, 6)

View File

@@ -25,4 +25,4 @@ def insertion_sort(nums):
if __name__ == '__main__':
nums = [4, 1, 3, 1, 5, 2]
insertion_sort(nums)
print("排序后数组 nums = ", nums)
print("排序后数组 nums =", nums)

View File

@@ -26,7 +26,7 @@ if __name__ == "__main__":
duque.appendleft(1)
print("双向队列 duque =", duque)
""" 访问队首元素 """
""" 访问元素 """
front = duque[0] # 队首元素
print("队首元素 front =", front)
rear = duque[-1] # 队尾元素