i have a problem of sorting a Queue with aspect to service set , Queue contains elements types of 3 different Services (Service A, Service B, Service C), now i need to sort the Queue in the form of Services sets (A,B,B,C). Like an array = { Service A,Service B,Service B,Service C,Service A,Service B,Service B,Service C,...}
i want to remove and add new elements in the same sequence ..
if an element is removed it should not replace the same type of element but it should bring up the element that placed next Like if i removed Service A result should be array = { Service B,Service B,Service C,Service A,Service B,Service B,Service C,...}
the current issue is after sorting Queue once an element is removed from Queue it supposed to move to next element of the set but it bring up the same type of element that i removed