Get the latest tech news
Shift-to-Middle Array: A Faster Alternative to Std:Deque?
An innovative data struicture for implementing lists and deques - attilatorda/Shift-To-Middle_Array
✅ Amortized O(1) insertions & deletions at both ends ✅ Fast random access (O(1)) ✅ Better cache locality than linked lists ✅ Supports SIMD & parallel optimizations ✅ Efficient memory usage compared to std::deque Traditional data structures, such as std::deque and linked lists, suffer from poor cache locality or fragmented memory allocations, leading to inefficiencies. By leveraging contiguous memory, dynamic mid-shifting, and modern CPU optimizations, Shift-To-Middle Array provides a balanced solution for insertion, deletion, and access performance.
Or read this on Hacker News