bits-and-blooms / bitset

Go package implementing bitsets
BSD 3-Clause "New" or "Revised" License
1.34k stars 175 forks source link

how would you implement CountTo(until uint) uint #153

Closed gaissmai closed 10 months ago

gaissmai commented 10 months ago

thanks for bitset

For a poptrie, I need a quick implementation not only of Count but also of CountTo. How would you implement this with this library without iteration?

lemire commented 10 months ago

You would use rank/select queries which are standard. See https://github.com/bits-and-blooms/bitset/pull/154

I will issue a release soon.