3.1-Linked_List

3.1-Linked_List - Node // data int data; Node next; 7 A...

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

View Full Document Right Arrow Icon
CMPT 225 Linked Lists
Background image of page 1

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

View Full DocumentRight Arrow Icon
CMPT 225 Linked Lists A linked list is a dynamic data structure consisting of nodes and links: 6 2 7 head 8 This symbol indicates a null reference
Background image of page 2
CMPT 225 Linked Lists Each node contains two things The data A pointer to the next node 7
Background image of page 3

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

View Full DocumentRight Arrow Icon
CMPT 225 Linked Lists class Node // data int data; Node next; 7
Background image of page 4
CMPT 225 Linked Lists class
Background image of page 5

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

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7

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

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

Unformatted text preview: Node // data int data; Node next; 7 A node points to another node, so the pointer must be of type Node CMPT 225 Building a Linked List Node aNode = create a new Node(7, null ); Assume weve added a constructor to the Node class that lets us initialize data and next like this. CMPT 225 Building a Linked List CMPT 225 Traversing a Linked List...
View Full Document

Page1 / 8

3.1-Linked_List - Node // data int data; Node next; 7 A...

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

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