|
-
February 18th, 2009, 07:08 AM
#3
Re: PLEASE help explain linked lists code to me!
The first part is simply defining the type that will be the backbone of a linked list: A Node. Each Node object carries some payload (an int in this case), and a pointer to the next Node in the list. If that pointer is NULL, then it is the last Node in a list. The class has three constructors.
The second part creates two linked lists. The first one is 5 -> 3 -> x, the second is 12 -> x, where x indicates list end or the NULL pointer. These two lists are pointed to by q and r respectively.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|