4 ms·
I think OR-Tools uses a sorted `std::vector` for this in `SortedDisjointIntervalList` [1] (if I get your description of the problem right). -- 1: https://or-
by emmanueloga_ 2y ago
I think OR-Tools uses a sorted `std::vector` for this in `SortedDisjointIntervalList` [1] (if I get your description of the problem right).
--
1: https://or-tools.github.io/docs/cpp/classoperations__research_1_1SortedDisjointIntervalList.html https://or-tools.github.io/docs/cpp/classoperations__researc...
- grovesNL 2y agoInteresting, thanks! It makes sense that OR-Tools would have something similar. I wonder if they have an explanation behind using `std::vector` vs. some other data structures. I could imagine `std::vector` doing pretty well but in practice I found vectors (Rust's `Vec` in my case) to be roughly on par with the ordered map I'm using. Obviously it can vary depending on how widely it has to binary search.