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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for range_max_query-1.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f545d0a91c330fa33b1fde067d739d31ed778c58daafc21184f984fd7c54115 |
|
MD5 | 658b07203878e25b0efefe06b785afc5 |
|
BLAKE2b-256 | 702d0b0cce245bc1f90a42062745551101e2e88f13db031fbce6fbce2db1778a |