title: What is the run time of shift/unshift in a ruby array
body: <p>Does anyone know how efficient shift and unshift are in a ruby array?</p>
  
  <p>Deleting from the beginning of an array and having to move every element in memory can become very inefficient. I assume ruby does this some other way.</p>
  
  <p>Any info on the following would be helpful:<br>
  - Algorithmic runtime<br>
  - Implementation<br>
  - General efficiency<br>
  - Would shift/unshift be acceptable to use for a queue (in something like C++ this would not)  </p>
  
  <p>Thank you!</p>