3 ms·
Dynamic arrays can be more appropriate than linked lists, depending on the context. Because dynamic arrays multiply the buffer size by a certain factor upon eve
by TheAsprngHacker 7y ago
Dynamic arrays can be more appropriate than linked lists, depending on the context. Because dynamic arrays multiply the buffer size by a certain factor upon every reallocation, growth of the array is amortized O(1). In addition, dynamic arrays get the benefit of the cache because the elements are contiguous.