Sign in to follow this  
AdamGL

Linked lists

Recommended Posts

Can someone explain linked lists to me. I've checked all the sites, I need a basic explanation and example. Thanks. :) Adam L

Share this post


Link to post
Share on other sites
No homework questions. =D

Since this sounds too much like homework, I'll keep it simple and let you figure out implementation.

You have an object, it has a "pointer" as an attribute which points to another object of the same type. This next object has a pointer attribute which points to the next object. By keeping track of the first object and placing each sucessive object in the pointer of the last object, you can find every object in this list just by following the trail of pointers.

Imagine a book, where every page was jumbled up, but each page told you where the next page is. From page 12, the next page is 27.

Share this post


Link to post
Share on other sites
Quote:
Original post by AdamGL
I've checked all the sites,


My god man! You must have super-human web-browsing powers! You don't need to know how to write a linked list with those powers on your side!

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this