▲ | mwkaufma 4 days ago | ||||||||||||||||
In principle it's not that different that deque, though: (1) deque uses fixed-sized blocks, not increasing-size blocks. (2) dequeue supports prepending, which adds another level of indirection internally. | |||||||||||||||||
▲ | sigbottle 4 days ago | parent [-] | ||||||||||||||||
You can support prepending by mirroring the allocations, probably? eg for the "negative index" case do an exponential thing in the other direction. Your indexing has some legitimate math to be done now which can be annoying (efficiency perspective) I think you can still get o(1) with careful allocation of powers of 2. | |||||||||||||||||
|