Easier would be to use a for loop from -50 to 50 to add the numbers to the queue.
Then you take the first elem and store it as the min value, then you remove all the elements but the last which is the max value, finally add the min value the queue again.