Data Structure
1. 基本資料結構
陣列(Array)
arr = [1, 2, 3]
print(arr[1]) # 輸出 2鏈結串列(Linked List)
class Node:
def __init__(self, value):
self.value = value
self.next = None堆疊(Stack)
佇列(Queue)
2. 樹與圖
二元樹(Binary Tree)
圖(Graph)
3. 雜湊表與集合
雜湊表(Hash Table / Dictionary)
集合(Set)
4. 時間與空間複雜度(Big-O)
操作
陣列
鏈結串列
堆疊/佇列
雜湊表
搜尋樹
小結
Last updated