Check interchangeable implementations

A PermitPool ADT has capacity C and initially has C free permits. For every positive integer k, take(k) returns true and removes k permits if at least k are free; otherwise it returns false without changing availability. available() returns the number free without changing the state. These are its only public operations.


Which implementations satisfy this contract for every permitted sequence of calls? Select all that apply. Judge only the specified results and state changes; ignore running time and storage use.

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Abstract Data Types (ADTs) Questions: