數據結構之python實現棧的鏈式存儲

順序存儲是分配一組連續的存儲單元 ,如果棧滿,不能再添加;採用鏈式存儲,可以需要多少存儲空間就申請多少空間。 python實現 class StackNode: def __init__(self): self.data = None self.next = None class LinkStack: def __init__(self):
相關文章
相關標籤/搜索