Week 02 Online - Linked Lists

Week 02 Online - Linked Lists - © 2010 David A. Smallberg...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: © 2010 David A. Smallberg Supplement to Linked List Lecture First some notation: When we show a pointer pointing to an object, it’s irrelevant where the arrowhead of the pointer touches the object. Thus, these two pictures of a situation where two pointers point to the same object mean the same thing: If the object were at memory address 1000, we assume both of these pictures mean that the two pointers both contain memory address 1000. (Under a notational convention we’re not using, one might consider the pointers in the right picture to hold different values, neither being memory address 1000.) The reason we use this convention is that when drawing a doubly-linked list, fewer lines cross each other in the picture. A straightforward way of representing a doubly-linked list of integers containing 10, 30, and 20 in that order would be head 10 30 20 NULL NULL This gives us direct access to the first item in the list, and from there we can reach every other item. But for many applications, a lot of activity occurs at the end of the list, so rather than starting at the beginning...
View Full Document

This note was uploaded on 04/02/2012 for the course COMPUTER S 32 taught by Professor Smallberg during the Winter '12 term at UCLA.

Page1 / 3

Week 02 Online - Linked Lists - © 2010 David A. Smallberg...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online