Computer Science, asked by rrchaudharice, 3 months ago

Let's imagine we add support to our dynamic array for a new operation PopBack (which removes the last element). Calling PopBack on an empty dynamic array is an error.

PopBack reallocates the dynamically-allocated array to a new array of half the capacity if the size is \leq≤ the capacity / 4 . So, for example, if, before a PopBack the size were 5 and the capacity were 8, then after the PopBack, the size would be 4 and the capacity would be 8. Only after two more PopBack when the size went down to 2 would the capacity go down to 4.

We want to consider the worst-case sequence of any nn PushBack and PopBack operations, starting with an empty dynamic array.

What potential function would work best to show an amortized O(1)O(1) cost per operation?

Φ(h)=2


\Phi(h) = max(0, 2\times size - capacity)Φ(h)=max(0,2×size−capacity)


\Phi(h) = 2 \times size - capacityΦ(h)=2×size−capacity


\Phi(h) = max(2 \times size - capacity, capacity/2 - size)Φ(h)=max(2×size−capacity,capacity/2−size)

Answers

Answered by kandasamy6888
0

Answer:

Heat is added to the cotton to bring the moisture level down so that it flows through the equipment properly. Then the fiber is pulled from the seed at the gin stand, ultimately passing through lint cleaners where smaller, finer particles are removed from the lint.

Similar questions