摘要:
1 def bubb_sort(list): 2 # 冒泡排序 3 for i in range(len(list)-1,0,-1): 4 for j in range(i): 5 tmp=list[0] 6 if list[j]>list[j+1]: 7 tmp=lis... 阅读全文
摘要:
QUEUE1 1 : class queue(object): 2 def __init__(self): 3 self.item=[] 4 5 def is_empty(self): 6 return self.item ==[] 7 8 def size(self): 9 return len(sel... 阅读全文
摘要:
1 class stack(object): 2 def __init__(self): 3 self.items=[] 4 5 def is_empty(self): 6 if len(self.items)>0: 7 return False 8 return True 9 10 ... 阅读全文
摘要:
class singlenode(object): def __init__(self,item): self.item=item self.next=None 1 class singlink(object): 2 def __init__(self): 3 self.head=None 4 5 def i... 阅读全文