Let’s go over our priority queue implementation. The reason for using heapq instead of other data types is that you can push and pop in O(log n) time while keeping the underlying data in order of priority. We’ll use the heapq available from the Lib/heapq.py module in Python for our priority queue implementation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |