This commit is contained in:
zhm-real
2020-08-05 12:53:19 -07:00
parent b3f190ec36
commit 8e232410ed
31 changed files with 296 additions and 219 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ class QueuePrior:
return len(self.queue) == 0
def put(self, item, priority):
heapq.heappush(self.queue, (priority, item)) # reorder x using priority
heapq.heappush(self.queue, (priority, item)) # reorder s using priority
def get(self):
return heapq.heappop(self.queue)[1] # pop out the smallest item