Arrays:
4 It is a set of values of same type
4 Predetermination of the size is a must.
4 Array elements are sequentially stored
4 Direct access to any element of the array is possible.
4 To insert and delete elements we need to traverse throughout the array.
4 Index plays key role.
4 There is a chance for Memory wastage or shortage.
Linked lists:
4 It is a set of nodes linked together, where node has information and reference parts.
4 No predetermination of number of nodes, because it uses dynamic memory allocation.
4 Nodes of the list are not stored sequentially.
4 Direct access to any element of the list is not possible.
4 To insert and delete elements we need not traverse throughout the list.
4 References play key role.
4 There is no Memory wastage.
0 comments:
Post a Comment