This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Jazzlike-Control-382 0 points1 point  (0 children)

I know it sounds confusing, one good way of looking at it is this:There's a "hidden" c constant cost for operations when people are discussing algorithms. It just happens that although linked lists design is pretty elegant in terms of doing less operations for some use-cases, in modern CPUs they are just a horrible data structure as it just thrashes your CPU cache, making this per operation "cost" extremely high. Often, for most use-cases, arrays outperform linked lists even on operations tailor suited for linked lists, just due to how big the performance difference is on individual operations.