3.1-Linked_List - Node data int data Node next 7 A node...

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

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

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

View Full Document Right 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
Image of page 2
CMPT 225 Linked Lists Each node contains two things The data A pointer to the next node 7
Image of page 3

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

View Full Document Right Arrow Icon
CMPT 225 Linked Lists class Node // data int data; Node next; 7
Image of page 4
CMPT 225 Linked Lists class
Image of page 5

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

View Full Document Right Arrow Icon
Image of page 6
Image of page 7

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

View Full Document Right Arrow Icon
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 we’ve 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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern