Results 1 to 4 of 4
  1. #1
    AlphaDog209's Avatar
    Join Date
    May 2012
    Gender
    male
    Posts
    17
    Reputation
    10
    Thanks
    5

    What is a linked list?

    Can someone explain me the difference between a LinkedList and an ArrayList?
    They have the same functions?

  2. #2
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Array list uses an array internally which is dynamically increased as you need it. (You don't see it happen)

    On a Linked list, every "member" is pointing to the next one. So, when you add a new member, there's the head/start of the list pointing at it. When you add another member, the previous one (who had the head of the list pointing at it), will point at this new one... etc..etc..etc..
    You dont need an array, yet they all are stored in order and all can be accessible.
    There is also another kind of linked lists, such as double linked list. Also stack, queue, etc...

    PS: Im pretty sure you can find a better explanation around the web, or someone posting here
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  3. The Following User Says Thank You to 'Bruno For This Useful Post:

    AlphaDog209 (10-20-2012)

  4. #3
    AlphaDog209's Avatar
    Join Date
    May 2012
    Gender
    male
    Posts
    17
    Reputation
    10
    Thanks
    5
    I think its kinda clear. An arraylist pre-reserves additional empty spots. And with a linked list this isnt needed cause the last element points to a new memory adress with the added element?

  5. #4
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Quote Originally Posted by AlphaDog209 View Post
    I think its kinda clear. An arraylist pre-reserves additional empty spots. And with a linked list this isnt needed cause the last element points to a new memory adress with the added element?
    pretty much, yes
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

Similar Threads

  1. Whats your favorite Weapon? List Free and Nexon
    By JustinFatalx in forum Combat Arms Discussions
    Replies: 25
    Last Post: 06-24-2010, 12:31 PM
  2. [TuT] Linked Lists
    By 'Bruno in forum C++/C Programming
    Replies: 0
    Last Post: 05-28-2010, 09:19 AM
  3. What's the Aimbot link?
    By Tylerw101 in forum Combat Arms Help
    Replies: 7
    Last Post: 08-23-2009, 09:12 PM
  4. what hack list
    By Hacker1209 in forum CrossFire Hacks & Cheats
    Replies: 1
    Last Post: 07-15-2009, 09:36 PM