Daniel Brockman wrote:

>Why not use String#shift, which is O(1)?
>
EDIT: Daniel later redacted this to Array#shift.  My question remains, 
however.

Many times when I hear an answer, I am more interested in how the answer 
was obtained than the answer itself, so that I can go find the answers 
to related questions myself.  This is a perfect example of this.

How do you know Array#shift is O(1)?  I'm not challenging you; I'm 
asking because I really want to know how to find this out.  Is it 
documented somewhere?  Did you profile it?  Did you read the source code?

-dB

-- 
David Brady
ruby-talk / shinybit.com
I'm having a really surreal day... OR AM I?