About 1,370,000 results
Open links in new tab
  1. heapq — Heap queue algorithm — Python 3.14.2 documentation

    1 day ago · Source code: Lib/heapq.py This module provides an implementation of the heap queue algorithm, also known as the priority queue algorithm. Min-heaps are binary trees for which every …

  2. Heap queue or heapq in Python - GeeksforGeeks

    Sep 3, 2025 · To use heap queues in Python, you need to import the heapq module in your code: import heapq. Heaps support several essential operations that help manage data efficiently while …

  3. Python heapq Module - W3Schools

    The heapq module provides heap (priority queue) algorithms on regular Python lists. Use it to push/pop the smallest item efficiently and to implement priority-based workflows.

  4. The Python heapq Module: Using Heaps and Priority Queues

    In this step-by-step tutorial, you'll explore the heap and priority queue data structures. You'll learn what kinds of problems heaps and priority queues are useful for and how you can use the Python heapq …

  5. The heapq (Heap Queue) Module in Python - TechBeamers

    Nov 30, 2025 · Python provides the heapq module (heap queue or priority queue) which simulates min heap using lists. This tutorial walks you through how to use heaps in Python with practical examples.

  6. Heap Queue or heapq in Python: The Complete Guide

    May 21, 2025 · In this comprehensive guide, I‘ll walk you through everything you need to know about heap queues in Python – from basic concepts to advanced techniques and real-world applications.

  7. Mastering `heapq` in Python: A Comprehensive Guide

    Jan 21, 2025 · This blog post will delve into the fundamental concepts of heapq in Python, explore its usage methods, discuss common practices, and present best practices to help you leverage this …

  8. Heap and Priority Queue using heapq module in Python

    Jul 23, 2025 · Heapq module is an implementation of heap queue algorithm (priority queue algorithm) in which the property of min-heap is preserved. The module takes up a list of items and rearranges it …

  9. Python heapq: Guide to Heaps in Python - oopstart.com

    Oct 12, 2024 · By the end of this guide, you’ll have a solid understanding of how to use the python heapq module in Python to efficiently manage priority queues and solve problems that involve …

  10. Heapq in Python (with examples) | Code Underscored

    In this article, we’ll explain how to use the heapq module in Python and show you some examples of how to use it with primitive data types and objects that contain complex data.