Linked list consists of nodes, where each nodes points to another node in the list.
Array consists of contiguous allocated memory
Linked list can grow a run time, each node can be any size, can grow upto recourse limits.
Array are normally fixed in size, so need to know the size in advance.
Downside to linked lists are sequential access. We need to traverse though the linked list to find any element.
Array, access is faster, because the location can be accessed very easily just by using mathematical equation.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment