Quantboy’s Weblog

Just another WordPress.com weblog

Perl Array Efficiency Questions Answered

I was wondering if it’s safe to use a shift on an array in Perl?  Wouldn’t Perl move all array items – taking just about forever on a large list?

The answer is- No.  Explained in detail on perlmonks.

It turns out the shift function is efficient to use in perl- an O(1) operation.

Advertisement

Written by quantboy

February 23, 2008 at 2:07 am

Posted in perl

Follow

Get every new post delivered to your Inbox.