Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!caen!ox.com!heifetz!tbomb!time From: time@ice.com (Tim Endres) Newsgroups: comp.sys.mac.programmer Subject: Re: How to best do a linked list on Mac Message-ID: <1CE00001.h0ibnk@tbomb.ice.com> Date: 13 Jun 91 18:14:21 GMT Reply-To: time@ice.com Organization: ICE Engineering, Inc. Lines: 27 X-Mailer: uAccess - Mac Release: 1.5 In article <6455@ns-mx.uiowa.edu>, wolf@piquet.cipl.uiowa.edu (Michael J. Wolf) writes: > If you wanted to not have empty sapces in the 'array' and wanted to do true insertions > so that your 'array' is always progressive, you could have your insert routine use a > temphandle, set that handle to point to the array item number where you wish to insert, > then do a HandtoHand copy, resize the List handle to add another item, then add the item > at the insertion point (just write over the original items data) then do a HandTohand copy > from the temp handle back to the List handle. This would be virtually the same for deleting > items also. > > In this scheme you would not need to have a next or previous pointer since the array is > always progressive. > > Just a thought... Have you thought about the time it takes to do tens of thousands of BlockMove()'s of say 50 KBytes? Arrays are wonderful for things like ptr's, but if my data structure is large, and I have many of them, then array insertion and deletion is unacceptable. ------------------------------------------------------------- Tim Endres | time@ice.com ICE Engineering | uupsi!ice.com!time 8840 Main Street | Voice FAX Whitmore Lake MI. 48189 | (313) 449 8288 (313) 449 9208