VibraXX
Live Quiz Arena
🎁 1 Free Round Daily
⚡ Enter Arena
HomeCategoriesLogic & PuzzlesQuestion
Question
Logic & Puzzles

A hash table uses amortized analysis with the banker's method for resizing. If inserting *n* elements requires 3*n* credits, which consequence follows regarding the cost?

A)Each operation has cost 3*n.
B)Each operation costs at most 3.
C)Some operations exceed cost 3*n.
D)Some operations have zero actual cost.

💡 Explanation

Using the banker's method, 3*n* credits mean that we can 'charge' each insert a cost of 3, therefore the amortized cost per operation is at most 3, because credits pay for resizing, rather than having individual operations cost 3*n*.

🏆 Up to £1,000 monthly prize pool

Ready for the live challenge? Join the next global round now.
*Terms apply. Skill-based competition.

⚡ Enter Arena

Related Questions

Browse Logic & Puzzles