3. With respect to arrays, establish the relationship between the size of the array and the time it takes to perform an insertion at the end of the array. Provide empirical evidence to support your answer.
The time taken to perform an insertion in the array is constant with respect to the size of array because we only need to know the current size of array to insert an element at the end which is not poosible in the case of a list.
More simply,
To insert at the end of an array, you simply have to put the item there.
To insert into the middle of an array, you need to move the items after that point up by one.
To delete from the end of an array, you just drop its count by one.
To delete from the middle you have to do that and shift the other items down.
PLEASE LIKE THE SOLUTION :))
IF YOU HAVE ANY DOUBTS PLEASE MENTION IN THE COMMENT
Get Answers For Free
Most questions answered within 1 hours.