Dec 21, 2018
Often when working with collections of data, you may want to find the smallest or largest item. It’s easy enough to write a function
that iterates through the items and returns the smallest or largest one, or use the builtin
Another interesting way may be implementing a heap (priority) queue.
Python provides a pretty convenient module called
heapq that does that for you.
heapq comes with a cool set of inbuilt functions that you can read
more about in the docs.