Merge Sort Tree in C++/Python
This is a C++ library with Python bindings for Merge Sort Tree. I was searching for a python wrapper merge sort tree but I couldn't find one,
so might as well create it.
This should work for both Python 2 and Python 3
To install, please clone the repository and run python setup.py install
from mergeSortTree import MergeSortTree
a = MergeSortTree()
a.build([i for i in range(100000)])
a.range_query(1000,50000,30000)
MergeSortTree()
return a new merge sort tree.a.build(vector)
take in an list of ints which you want to build the merge sort tree on.aa.range_query(x,y,k)
return the number of elements in range x to y which is smaller or equal to k. x, y, k are all ints.