Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

heapq_max

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heapq_max

A max Heap version of heapq module for Python.

  • 0.21
  • PyPI
  • Socket score

Maintainers
1

Heapq_max

Description

A maxHeap version of heapq module for Python. Similar to heapq, c implementation is used when available to ensure performance.

Dependencies

Python 2 or 3

Installation

::

pip install heapq_max

Usage

tl;dr: same as heapq module except adding '_max' to all functions.

::

from heapq_max import *

heap_max = []                           # creates an empty heap
heappush_max(heap_max, item)            # pushes a new item on the heap
item = heappop_max(heap_max)            # pops the largest item from the heap
item = heap_max[0]                      # largest item on the heap without popping it
heapify_max(x)                          # transforms list into a heap, in-place, in linear time
item = heapreplace_max(heap_max, item)  # pops and returns largest item, and
                                        # adds new item; the heap size is unchanged

License

MIT

History

0.21 ''''

Small fix of download URL&README

0.2 '''

Add Python 2 support

0.1 & 0.11 '''''''''''

First version, only supports Python 3

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc