Using the same queue, do "bubble sort" length(queue) times:
void bubbleSortQueue(std::queue* toSort )
{
int length = toSort->size();
if (length front();
toSort->pop();
for (int currItem = 0; currItem front();
toSort->pop();
if (first > second)
{
toSort->push(second);
}
else
{
toSort->push(first);
first = second;
}
}
toSort->push(first);
}
}