Question: Why we can change the size of list after its creation when we can not do that in simple arrays.
Answer: Some how the answer will be same as part 1 because Inserting or removing an element into a
linked list requires one data update, inserting or removing an element into an array requires n (all
elements after the modified index need to be shifted).
Array is a collection of same data type. The size of array is mentioned with its declaration. in
arrays the elements are in contiguous position. one must after another. while in linked list we
gave the address of next element in the next part of node.
Join Our Groups: http://groups.google.com/group/vubest
Like Vubest on Facebook
Answer: Some how the answer will be same as part 1 because Inserting or removing an element into a
linked list requires one data update, inserting or removing an element into an array requires n (all
elements after the modified index need to be shifted).
Array is a collection of same data type. The size of array is mentioned with its declaration. in
arrays the elements are in contiguous position. one must after another. while in linked list we
gave the address of next element in the next part of node.
Join Our Groups: http://groups.google.com/group/vubest
Like Vubest on Facebook
Comments
Post a Comment