fclaude / libcds

Compact Data Structures Library
http://libcds.recoded.cl
GNU Lesser General Public License v2.1
124 stars 24 forks source link

Added Intersection of k ranges over T[0..n]. #5

Open mpetri opened 13 years ago

mpetri commented 13 years ago

Added Intersection of k ranges over T[0..n]. based on

"New Algorithms on Wavelet Trees and Applications to Information Retrieval" by Travis Gagie, Gonzalo Navarro, Simon J. Puglisi.

works for both the WaveletTree (any shape) and WaveletTreeNoPtr.

Example:

A [7,2,11,13,11,15,7,2]

ranges A[0,2] , A[4,6] -> WaveletTree::intersection(ranges) returns 7,11.

testIntersection.cpp included.