I know stack is best and easiest way, yet could it be possible to obtain the last element in a queue without having to dequeue anything?
Queue's are not set up to make that operation fast, so the best you can do is O(n).
If you import System.Linq, you can write: myQueue.Last()
myQueue.Last()