Python Programming - Standard Libraries - Discussion
Discussion Forum : Standard Libraries - General Questions (Q.No. 79)
79.
What is the purpose of the
heapq
module?
Answer: Option
Explanation:
import heapq
# Example usage of heapq module for implementing a priority queue
priority_queue = []
heapq.heappush(priority_queue, 3)
heapq.heappush(priority_queue, 1)
heapq.heappush(priority_queue, 4)
print(priority_queue)
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers