an old homework solution about queues written in c++