Beefy Boxes and Bandwidth Generously Provided by pair Networks
Frank "be consistent"  Re^3: Data structures in Perl. A C
programmer's perspective.  by davido (Bishop) on Sep 07, 2013 at
04:56 UTC ( #1052800=note: print w/ replies, xml ) Need Help??
in reply to Re^2: Data structures in Perl. A C programmer's
perspective. in thread Data structures in Perl. A C programmer's
perspective.  My post was really about order of growth for
various tasks given two different data structures.  An array
stores its data linearly, in contiguous memory. If you want to
find the "nth" element, you go straight to it (it's a simple
mathematical computation, internally). But if you want to insert
between "n" and "n+1" you must shift everything from n+1 through
the end of the array out one spot, and hopefully not have to
copy the entire array to a larger block of contiguous memory.  A
linked list stores its data all over the place. Each element
just points to the location of the next one. Finding the 'nth'
element means starting at