Intro to Priority Queues – HiredInTech – Medium
Think about a regular queue in a supermarket. People come at one end along with their groceries and move forward until they reach the cash register. Once everything is paid for, the person leaves the queue and everyone behind can move forward by one position. Now imagine a supermarket in which people who have special client cards can bypass people in the queue who don't have such cards and get served earlier. These special card-owners have higher priority than the unlucky ones who haven't had a chance to get a card. This queue is a priority queue because people don't come out of the queue necessarily in the same order in which they've arrived but rather based on the priority that they have.
Read full article from Intro to Priority Queues – HiredInTech – Medium
No comments:
Post a Comment