2 ms·
I implemented the "2-level rotated array" structure a few years ago, which isn't designed to be used as a deque, but is at least less pathological than this (O(
by senderista 2y ago
I implemented the "2-level rotated array" structure a few years ago, which isn't designed to be used as a deque, but is at least less pathological than this (O(1) push_back/pop_back, O(sqrt(n) push_front/pop_front/insert/delete).
https://github.com/senderista/rotated-vec https://github.com/senderista/rotated-vec
- kragen 2y agoOh, fantastic!