Vaidas Armonas
Apr 13, 2021

--

That is how you expand an `array`. Array is a very different data structure than a linked list, and therefore has different properties. Arrays are fast, because they are a space in memory located closely together, while linked list is just a collection of nodes with pointers to the next item. Therefore indexing in to the list is very slow, as you need to cycle through all the elements up until the one you need (a simplification), while you can lookup the exact value in the array, because you know where the element is in memory.

--

--

Vaidas Armonas

Technically minded Data Scientist with experience in different business domains. Business School graduate. Enjoy learning all things ML/CS.