Practice question · True or false
Documenting a List ADT by writing down the array implementation's exact timings makes the documentation more useful, because callers know what to expect.
Hints
- What happens when the implementation is later swapped?
- The point of an ADT is that callers depend on the interface only.
Show the answer
False
Why
False. It converts an implementation detail into a promise. Callers write code that relies on O(1) indexing, and swapping in a linked list, still a correct List, silently makes them quadratic. Document the contract (asymptotic bounds the ADT guarantees), not the timings one implementation happens to have.
Practise Abstract Data Types and Interfaces
The app has 6 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.
More questions on Abstract Data Types and Interfaces
- A List ADT is being documented. Sort each statement by whether it belongs to the interface or describes one…
- A program uses a List ADT backed by an array. The implementation is swapped for a linked one and not a single…
- A program uses a List ADT. Its array implementation is replaced by a linked one, and every published…
- A team swaps a List implementation from array-backed to linked, changes no calling code, and the nightly…