Data structure name: combination array/linked list

Posted by me_and on Stack Overflow See other posts from Stack Overflow or by me_and
Published on 2010-06-02T10:46:57Z Indexed on 2010/06/02 10:54 UTC
Read the original article Hit count: 135

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:

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.

Thus you have:

Static array
—————————————————————————
|1|2|3|4|5|6|7|8|9|a|b|c|
—————————————————————————

Linked list
————  ————  ————  ————  ————
|1|*->|2|*->|3|*->|4|*->|5|*->NULL
————  ————  ————  ————  ————

My thing:
————————————  ————————————
|1|2|3|4|5|*->|6|7|8|9|a|*->NULL
————————————  ————————————

© Stack Overflow or respective owner

Related posts about algorithm

Related posts about language-agnostic