摘要:
from pythonds.basic.deque import Deque class Deque: def __init__(self): self.items = [] def isEmpty(self): return self.items == [] def addFront(self, item): se... 阅读全文
摘要:
from pythonds.basic.queue import Queue import random def hotPotato(namelist,num): simqueue = Queue() for name in namelist: simqueue.enqueue(name) while simqueue.size()>1: ... 阅读全文
摘要:
from pythonds.basic.stack import Stack def parChecker(symbolString): s=Stack() balanced=True index=0 while index 0: rem = decNumber % 2 remstack.push(rem) d... 阅读全文