true , but thats a bruteforce approach. If we are talking about minimum then one more solution is possible. Try to keep the latest inserted element at the Front pointer.
1: Insert x at rear node
2: perform dequeue followed by enqueue until x reaches the FRONT.