Created
June 19, 2022 03:02
-
-
Save wanderindev/79a068049fcd2a8007e77c3b2d012da2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def insert(self, task: str, priority: int) -> None: | |
| """Add an item to the priority queue""" | |
| heapq.heappush(self.pqueue, (priority, self.insertion_count, task)) | |
| self.insertion_count += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment