Implemented Method reverseQueue