Skip to main content

Python implementation of range maximum query in O(logn).

Project description

rangeMaxQuery

Python's implementation of range maximum query.

Install

  • Install via $ pip install range_max_query .

How to use

  • $ from range_max_query import RangeMaxQuery .

>>> A = [2, 3, 4, 1, 7]         
>>> arr = RangeMaxQuery(A)      # initialize data structure
>>> arr.range_max_query(1, 4)     # maximum query in range(1, 4)
7
>>> arr.update(1, 10)           # set A[1] = 10 and update the data structure
>>> arr.range_max_query(1, 4)    # maximum query in range(1, 4)
10

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

range_max_query-1.0.3.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

range_max_query-1.0.3-py2.py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page