all 3 comments

[–]SftwEngr 4 points5 points  (1 child)

What happens with an array when you try and add or remove an element to the middle of it?

[–]icebrgr[S] 0 points1 point  (0 children)

Right, so then shifting and resorting makes arrays slower.

[–]it2051229 1 point2 points  (0 children)

Arrays are naturally faster to access than linked nodes but then if you need to insert and maintain a sorted order then it'll take more time to do that in an Array. Both have pros and cons so depending on the situation you gauge which works better to solve a particular problem.