Explanation is. I am having data in one queue. And also I am having three other queues. The process is I will pop each time one element from main queue and check the sizes of the 3 queues and insert the data in the queue which is havin minmum size
There are quite a few Queue articles for you to explore specially Queue implementation through linked list