You operate a market place for buying & selling used textbooks For a giventext book eg“TheoryofCryptography”
there are people who want to buy this textbook and people who want to sell
OfferstoBUY:1009990
OfferstoSELL:110114119
A match occurs when two people agree on a price Some newoffers donotmatchTheseoffersshouldbeaddedtotheactivesetofoffers
Forexample:TimofferstoSELLat$150ThiswillnotmatchNooneiswillingtobuyatthatpricesowesavetheoffer
OfferstoSELL::110114119$150
Whenmatchingwewanttogivethecustomerthe“bestprice”
Examplematches:IfJaneofferstoBUYat$120
shewillmatchandbuyabookfor$109(thelowestoffer