Use of priority queue to simulate a super market