HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
attilatorda
Shift-To-Middle_Array
C++2025–2025
attilatorda / Shift-To-Middle_Array

Shift-To-Middle_Array

An implementation strategy for lists, queues, deque(ue)s.

4Distinct people
4Mentions
1Explicit recommenders
120GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

An implementation strategy for lists, queues, deque(ue)s.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

There’s a PDF with the results in the repo: https://github.com/attilatorda/Shift-To-Middle_Array/blob/ma... BTW, if OP is reading this, I recommend having the baseline in your…

nbonaparte used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 10:02:05 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by hour4 dated mentions

Observed mentions: 2025-03-23 23:20:27 UTC to 2025-03-24 10:02:31 UTC.

0122025-03-23 23:00:00 UTC to 2025-03-24 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 commentsMar 23, 23:002025-03-24 00:00:00 UTC to 2025-03-24 01:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-03-24 01:00:00 UTC to 2025-03-24 02:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2025-03-24 02:00:00 UTC to 2025-03-24 03:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-03-24 03:00:00 UTC to 2025-03-24 04:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-03-24 04:00:00 UTC to 2025-03-24 05:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsMar 24, 04:002025-03-24 05:00:00 UTC to 2025-03-24 06:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-03-24 06:00:00 UTC to 2025-03-24 07:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-03-24 07:00:00 UTC to 2025-03-24 08:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-03-24 08:00:00 UTC to 2025-03-24 09:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-03-24 09:00:00 UTC to 2025-03-24 10:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-03-24 10:00:00 UTC to 2025-03-24 11:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsMar 24, 10:00

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Mar 23, 23:002025-03-23 23:00:00 UTC2025-03-24 00:00:00 UTC110
Mar 24, 00:002025-03-24 00:00:00 UTC2025-03-24 01:00:00 UTC000
Mar 24, 01:002025-03-24 01:00:00 UTC2025-03-24 02:00:00 UTC202
Mar 24, 02:002025-03-24 02:00:00 UTC2025-03-24 03:00:00 UTC000
Mar 24, 03:002025-03-24 03:00:00 UTC2025-03-24 04:00:00 UTC000
Mar 24, 04:002025-03-24 04:00:00 UTC2025-03-24 05:00:00 UTC000
Mar 24, 05:002025-03-24 05:00:00 UTC2025-03-24 06:00:00 UTC000
Mar 24, 06:002025-03-24 06:00:00 UTC2025-03-24 07:00:00 UTC000
Mar 24, 07:002025-03-24 07:00:00 UTC2025-03-24 08:00:00 UTC000
Mar 24, 08:002025-03-24 08:00:00 UTC2025-03-24 09:00:00 UTC000
Mar 24, 09:002025-03-24 09:00:00 UTC2025-03-24 10:00:00 UTC000
Mar 24, 10:002025-03-24 10:00:00 UTC2025-03-24 11:00:00 UTC101

What Hacker News says

2 sources
You don't want to always resize to same-size buffers in that situation; consider a size-1024 buffer containing 1023 elements and a free space on the right. Pushing another item on the left can be done in the very same buffer, but requires copying all 1023 items one space to the right. If you then pop another item off the right end you are back to the starting state, so by repeating the process you need 511.5 element copies (in general, O(N) copies) per push or pop. There are obvious ways to resolve problems like this, but there are tradeoffs among them, and I would like to know which way the author chose and what the resulting complexity is without having to analyze (and debug) 270 lines of C++. Hmm, there's a PDF at https://github.com/attilatorda/Shift-To-Middle_Array/blob/ma...... but it also doesn't explain things like this. It make
Read the rest
s assertions about big-O performance, but doesn't explain the algorithm in enough detail to know whether they are correct.
In Shift-to-Middle Array: A Faster Alternative to Std:Deque?

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.