ch4-1-Lists - Chapter 4 - Linked Lists Linked Lists list...

Info iconThis preview shows pages 1–10. 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

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight 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: Chapter 4 - Linked Lists Linked Lists list elements are stored, in memory, in an arbitrary order explicit information ( called a link) is used to go from one element to the next Memory Layout a b c d e c a e d b A linked representation uses an arbitrary layout. Layout of L = (a,b,c,d,e) using an array representation. Linked Representation pointer (or link) in e is NULL c a e d b use a variable first to get to the first element a first Normal Way To Draw A Linked List link or pointer field of node data field of node a b c d e NULL first Chain A chain is a linked list in which each node represents one element. There is a link or pointer from one element to the next. The last node has a NULL (or ) pointer. a b c d e NULL first Node Representation typedef struct listNode *listPointer; typedef struct { char data; listPointer link; } listNode; link data get(0) desiredNode = first; // gets you to first node return desiredNode- data; a b c d e NULL first get(1) desiredNode = first- link; // gets you to second node return desiredNode- data; a b c d e NULL first get(2)...
View Full Document

This note was uploaded on 04/13/2011 for the course DATA STRUC 101 taught by Professor Hansanyong during the Spring '11 term at 한동대학교.

Page1 / 26

ch4-1-Lists - Chapter 4 - Linked Lists Linked Lists list...

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

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