Repairing a stock-record key

A retailer keeps one current stock record for every combination of warehouse identifier and product code. Each warehouse holds many products, and the same product can be held at several warehouses. An application stores these records in a map keyed only by product code. When another warehouse's record for the same product is assigned to that key, the earlier value is replaced. The application needs direct lookup of one warehouse's stock record for one product. Which revision best meets that need without losing the separate records?

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 Data Structures Questions: