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

priority-search-tree

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

priority-search-tree

Priority search tree data structure

  • 0.1.0
  • PyPI
  • Socket score

Maintainers
1

======== Overview

The priority search tree (PST) is data structure (mutable mapping {key: priority}) with the following properties:

  • Keys are stored in binary search tree (red-black tree in this case).
  • Maintains max heap properties (can return key with max priority in constant time).
  • Ability to perform efficient 3-sided search (finds items with key in interval [min_tree_key,max_tree_key] and priority is grater or equal to bottom_priority).

For example PST can store 2 dimensional points P(X,Y) using X coordinate as key and Y coordinate as priority. Such PST can perform 3 sided search to find points with X in [X_MIN,X_MAX] and Y >= Y_BOTTOM.

Installation

::

pip install priority-search-tree

You can also install the in-development version with::

pip install https://github.com/yusinv/priority-search-tree/archive/develop.zip

Documentation

https://priority-search-tree.readthedocs.io/

Development

To run all the tests run::

tox

Licence

Free software: GNU Lesser General Public License v3 or later (LGPLv3+)

Changelog

0.0.0 (2024-03-04)

  • First release on PyPI.

0.0.1 (2024-03-24)

  • Initial implementation.

0.0.2 (2024-03-26)

  • Added sorted_query method.
  • Added len and contains methods.
  • Added clear method.
  • Fixed issue with not unique heap keys

0.1.0 (2024-04-08)

  • Refactoring
  • Added PrioritySearchSet class
  • Added iter method

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