Data Structures & AlgorithmsModerateProduct Company SDE · complexity
Problem: What does the term 'amortised analysis' mean?
- A. The average cost per operation over a worst-case sequence of operations
- B. The cost of a single operation in the best case
- C. The expected cost over random inputs
- D. The cost in memory
Correct answer: A. The average cost per operation over a worst-case sequence of operations
Amortised bounds average the cost over a sequence, so occasional expensive operations are paid for by cheap ones.
More Coding Interview Problems questions
- Problem: What is the complexity of computing the number of inversions using a Fenwick tree over n distinct values?
- Problem: Which operation is the bottleneck of the naive recursive Fibonacci algorithm?
- Problem: What is the worst-case complexity of Heapsort on n elements?
- Problem: What is the property of a 'Monge' matrix that enables fast DP optimisation?
- Problem: Which problem is classically solved by the 'convex hull trick' in DP with linear functions?
- Problem: What is the cost of inserting into a binary search tree that is perfectly balanced with n nodes?