摘要: directedGraph.py 阅读全文
posted @ 2017-06-03 17:44 JustLittle 阅读(4667) 评论(0) 推荐(0)
摘要: 1 import heapq #导入heapq堆模块 2 import random 3 data = random.sample(range(1000),10) 4 print(data) 5 heapq.heapify(data) #堆化随机测试数据 6 print('堆化随机测试数据:',data) 7 heapq.heappush(data,30) #新元素入堆,自动... 阅读全文
posted @ 2017-06-03 14:01 JustLittle 阅读(375) 评论(0) 推荐(0)
摘要: BinaryTree.py useBinaryTree.py 阅读全文
posted @ 2017-06-03 11:44 JustLittle 阅读(266) 评论(0) 推荐(0)
摘要: customStack.py useCustomStack.py 阅读全文
posted @ 2017-06-03 10:57 JustLittle 阅读(2235) 评论(0) 推荐(0)
摘要: from queue import Queue #LILO队列q = Queue() #创建队列对象q.put(0) #在队列尾部插入元素q.put(1)q.put(2)print('LILO队列',q.queue) #查看队列中的所有元素print(q.get()) #返回并删除队列头部元素pri 阅读全文
posted @ 2017-06-03 08:44 JustLittle 阅读(23288) 评论(0) 推荐(1)