title: How efficient is IEnumerable.First and IEnumerable.Last?
body: <p>I want to use a System.Collections.Generic.Queue, but with one difference: I want Queue.Peek to return the last item put in rather than the first. I still want items to enter and exit in the same manner.</p>
  
  <p>I was thinking of using Queue.Last() as an alternative to Queue.Peek() (which I assume is basically the same as Queue.First()) But I'm wondering if this means an enumerator will literally enumerator over the entire queue before reaching the last element. Since my queues will be very large, this can be a problem.</p>
  
  <p>EDIT:</p>
  
  <p>To put into perspective what I'm trying to do: Say I want to keep a minute by minute database of the price of a stock for the last 20 years. This would be many data points. In order to do this, I would like to enqueue the lastest price at every minute, and dequeue the earliest price when the size of the queue gets above 20 years. However, I also want a convenient way to get the most recent price from the queue. I know about Queue.Last(), which will do the trick, but I just want to know if it will be terribly inefficient.</p>