I'm currently working on a project that requires me to iterate over a list of values and add a new value between each value already on the list. This will happen at each iteration, so the list will grow exponentially. I decided that implementing a list as a linked list would be a great idea. Now JS does not have a default Linked List data structure, and I have no problem creating it.
But my question is, is it worth creating a simple Linked List from scratch, or would it be best to create an array and use splice () to insert each element? Will it really be less efficient due to overhead?
performance javascript memory-management linked-list arrays
Dimi
source share