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.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of middle

middle

Photo of array

array

Photo of std

std

Related news:

News photo

Improving on std:count_if()'s auto-vectorization

News photo

Mark Cuban offers to fund government tech unit that was cut in the middle of the night

News photo

Apple Plans to Overhaul China iPhones With AI by Middle of Year