Note that there are some explanatory texts on larger screens.

plurals
  1. POData structure name: combination array/linked list
    primarykey
    data
    text
    <p>I have come up with a data structure that combines some of the advantages of linked lists with some of the advantages of fixed-size arrays. It seems very obvious to me, and so I'd expect someone to have thought of it and named it already. Does anyone know what this is called:</p> <p>Take a small fixed-size array. If the number of elements you want to put in your array is greater than the size of the array, add a new array and whatever pointers you like between the old and the new.</p> <p>Thus you have:</p> <pre><code>Static array ————————————————————————— |1|2|3|4|5|6|7|8|9|a|b|c| ————————————————————————— Linked list ———— ———— ———— ———— ———— |1|*-&gt;|2|*-&gt;|3|*-&gt;|4|*-&gt;|5|*-&gt;NULL ———— ———— ———— ———— ———— My thing: ———————————— ———————————— |1|2|3|4|5|*-&gt;|6|7|8|9|a|*-&gt;NULL ———————————— ———————————— </code></pre> <p><strong>Edit</strong>: For reference, this algorithm provides pretty poor worst-case addition/deletion performance, and not much better average-case. The big advantage for my scenario is the improved cache performance for read operations.</p> <p><strong>Edit re bounty</strong>: Antal S-Z's answer was so complete and well-researched that I wanted to provide em with a bounty for it. Apparently Stack Overflow doesn't let me accept an answer as soon as I've offered a bounty, so I'll have to wait (admittedly I am abusing the intention bounty system somewhat, although it's in the name of rewarding someone for an excellent answer). Of course, if someone <em>does</em> manage to provide a better answer, more power to them, and they can most certainly have the bounty instead!</p> <p><strong>Edit re names</strong>: I'm not interested in what <em>you'd</em> call it, unless you'd call it that because that's what authorities on the subject would call it. If it's a name you just came up with, I'm not interested. What I want is a name that I can look up in text books and with Google. (Also, here's a tip: Antal's answer is what I was looking for. If your answer isn't "unrolled linked list" without a <em>very</em> good reason, it's just plain wrong.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload