What would be the advantage of using a linked list of arrays?
I have read that if the data is large and insertions are allowed (for example, a text buffer), then a common halfway measure is to use a linked list of arrays .
But there was no explanation on what is the benefit of using such a structure.
Or at least I did not get it.
So what would be the gain in using a linked list of arrays and when?
linkedlistwhich has slow access but fast insertions and deletions and anarraywhich is exactly the opposite.I thought that may be this is a common "trick" I am not awareArrayListis the same asstd::vectorin C++, it's a pretty thin wrapper for an array, and if the insertion index exceeds the initially allocated size, the whole array gets realloced and copied. This is unnoticable for small amounts of data, but once you start reallocating and copying a few GBs, you get the gist... Hence the name Array List.LinkedListofArrayList, right? You don't want to mix up java collections with standard arrays, or do you?