DEV Community

Discussion on: Deep Dive into Data structures using Javascript - Circular Linked List

Collapse
 
humblecoder00 profile image
Şahin Arslan • Edited

Hi Luke,

Thanks for your interesting feedback and taking time for testing the performance! When it comes to performance on data structures, unfortunately there is no silver bullet that is good at everything. They are good and bad on different things. Other than that, if we are speaking about Web development - this is definitely not something we often deal with in day to day life, at least in my case. I can't recall directly using a Linked list for any real world app yet - not even once. But the main objective here is more about getting to know the data structure and it's underlying concepts.

Main performance differences between Arrays and Linked Lists are traversals and operations at the beginning of the list. Array outperforms Linked List when it comes to traversal, while Linked List outperforms Array with operations at the beginning of the list (to be more exact anywhere in the list as long as you have a reference to it's pointer). This is due to the difference between how Arrays and Linked lists being physically stored in memory and how they operate under the hood. These have direct consequence on how fast and efficient we can work with the memory. I have shared more details about this on my blog post about Linked List:

dev.to/humblecoder00/deep-dive-int...

Cheers!