Double Queue (STL)

The new founded Balkan Investment Group Bank (BIG-Bank) opened a new office in Bucharest, equipped with a modern computing environment provided by IBM Romania, and using modern information technologies. As usual, each client of the bank is identified by a positive integerKand, upon arriving to the bank for some services, he or she receives a positive integer priorityP. One of the inventions of the young managers of the bank shocked the software engineer of the serving system. They proposed to break the tradition by sometimes calling the serving desk with thelowestpriority instead of that with the highest priority. Thus, the system will receive the following types of request:

0The system needs to stop serving

1KPAdd clientKto the waiting list with priorityP

2Serve the client with the highest priority and drop him or her from the waiting list

3Serve the client with the lowest priority and drop him or her from the waiting list

Your task is to help the software engineer of the bank by writing a program to implement the requested serving policy.

,失败是成功之母

Double Queue (STL)

相关文章:

你感兴趣的文章:

标签云: