(a) Consider A to be the size of the array list.
Let P be the size of pointer.
The size of an int element is 4 bytes.
Therefore, the breakeven point as a function of n, beyond which the array-based list is more space efficient than the linked list for lists whose elements are of type int is :
n> (4*D)/(P+4)
(b) Consider A to be the size of the array list.
Let P be the size of pointer.
The size of an int element is 8 bytes.
Therefore, the breakeven point as a function of n, beyond which the array-based list is more space efficient than the linked list for lists whose elements are of type double is :
n> (8*D)/(P+8)
Get Answers For Free
Most questions answered within 1 hours.