Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24

Thread: Linked Lists

  1. #21

    Linked Lists

    Yeah, thats what i meant im sorry. I've got my dynamic array working fairly fast for my animations. Thanks for the help and clarifications
    I have a 2005 CRF 250 so <^>(>&lt<^>
    <br />http://www.gtrpg.com/

  2. #22
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Linked Lists

    Not relevant any more but

    http://www.awitness.org/delphi_pasca...nked_list.html

    has an example on creating linked lists the good old fashioned way
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  3. #23

    Linked Lists

    From you?¢_~re adding and removing question?¢_Ts it looks like you?¢_Tve got an incorrect view of how setlength works. It makes no sense to increment or decrement dynamic array size be one, because when resizing the array what happens is a new chunk of memory is allocated, then the old values get copied and the old array gets destroyed. It?¢_Ts a much better idea to keep a counter of how many items you have in the array, and if it?¢_Ts full make it larger by some (certainly bigger than one) value. When removing items from the array the fastest way if you do not care about item order is to copy the last item over the item you?¢_Tre deleting and decrement the item counter, but if you care about item order and don?¢_Tt have a lot of items a linked list will be faster.

  4. #24
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Linked Lists

    If you are storing instances of a class in the Array you are effectivly only storing a pointer anyway. (So size allocation isn;t too relevant) but it is a good point that decreasing the array is going to be slow and it is more efficient to store the whole array all the time.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

Page 3 of 3 FirstFirst 123

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •