Re:Show HN: Array with Constant Time Access and Fast Inserti...
by kadoban on Tuesday September 03, 2019 @09:04PM
(#20873019)
You've answered your own question implicitly. The address of the starting and ending element can change. You just define yourself where in the backing array the start/end are, and let them wrap around (use modular arithmetic for the indexes).
[ Parent
| on HN ]
Re:Show HN: Array with Constant Time Access and Fast Inserti...
by panda88888 on Tuesday September 03, 2019 @09:07PM
(#20873040)
Thanks! DEQ implementation with circular buffer. :)
Edit: should have thought of that. Brain fart—-long day at work.