示例#1
0
class PriorityQueue:
    def __init__(self):
        self.order = BinaryHeap()
    def __str__(self):
        temp = self.order.copyHeap()
        front = temp.delete()
        string = ("<Front>\n")
        while front:
            string+= (" %s"%front)
            front = temp.delete()
        string += "<BACK>"
        return string
    def enQueue(self,Node):
        self.order.insert(Node)
    def deQueue(self):
        return self.order.delete()
示例#2
0
class PriorityQueue:
    def __init__(self):
        self.order = BinaryHeap()

    def __str__(self):
        temp = self.order.copyHeap()
        front = temp.delete()
        string = ("<Front>\n")
        while front:
            string += (" %s" % front)
            front = temp.delete()
        string += "<BACK>"
        return string

    def enQueue(self, Node):
        self.order.insert(Node)

    def deQueue(self):
        return self.order.delete()
示例#3
0
 def __init__(self):
     self.order = BinaryHeap()
示例#4
0
 def __init__(self):
     self.order = BinaryHeap()