From: Eric Hodel Date: 2005-04-05T04:53:57+09:00 Subject: Re: doubly linked list in Ruby? --Apple-Mail-2--954267617 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On 04 Apr 2005, at 12:39, Randy Kramer wrote: > On Monday 04 April 2005 03:09 pm, Tim Hunter wrote: >> Ruby arrays are incredibly more flexible than C arrays. You can insert >> an element into an array _between_ two other elements. >> >> a = [1,2,3] >> a[1,0] = 4 => [1,4,2,3] >> >> You can delete an element from an array any number of ways. The >> delete_at method works if you know the index of the element you want >> to >> delete. > > But (just asking), what about performance? Why do you care? Until you've written the app and profiled it and found that Array insertion is slow, there's no point in attempting to optimize it. Premature optimization is the root of all evil. -- Eric Hodel - drbrain@segment7.net - http://segment7.net FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --Apple-Mail-2--954267617 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iEYEARECAAYFAkJRmzUACgkQMypVHHlsnwSjOQCgv2YOIXlgjvRHrUjTEYNgA9Ov 4DMAoPCvsVRUQDketaGB2sWpqST/lvEz =efeI -----END PGP SIGNATURE----- --Apple-Mail-2--954267617--