I know the differences but I have a problem to understand with 1 major difference. It is Array has fixed size and Linked List has dynamic size. I really don’t understand this as I can define an empty array like below
var arr = [ ];
And insert whenever required like normal push or like
arr = "apple"; arr = "banana"; arr = "custard";
and so on…
Infact when the length is unknown I can do like
arr[arr.length] = "zuccini";
So I can change the size at runtime or declare an empty array and thus make it dynamic. So the claim that array has a disadvantage of fixed size as compared to linked list which has an dynamic size isn’t wrong? Please help me in clearing out this confusion. Thank you!