LinkedList - CSC438 DATA STRUCTURES Zulaile Mabni TOPIC 3...

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

View Full Document Right Arrow Icon
CSC438 D ATA S TRUCTURES TOPIC 3 Linked List Zulaile Mabni 1 7/26/2010
Image of page 1

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

View Full Document Right Arrow Icon
C HAPTER O BJECTIVES Learn about the Java Collection Framework Learn about the List interface Learn about Linked List 2 Zulaile Mabni 7/26/2010
Image of page 2
T HE L IST I NTERFACE 7/26/2010 3 Koffman E.
Image of page 3

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

View Full Document Right Arrow Icon
A RRAY L ISTS VS . L INKED L ISTS Array List: Fast access to elements Slower insertion/deletion of elements add and remove methods operate in linear time because they require a loop to shift elements in the underlying array. Linked list: Slower access to elements Fast insertion/deletion of elements ability to add or remove items anywhere in the list in constant time. 7/26/2010 4 Zulaile Mabni
Image of page 4
5 L INKED L ISTS Definition: a list of items, called nodes, in which the order of the nodes is determined by the address, called the link, stored in each node. Every node in a linked list has two components: one to store relevant information one to store address (the link ) of next node in list 7/26/2010 Zulaile Mabni
Image of page 5

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

View Full Document Right Arrow Icon
6 L INKED L ISTS Address of first node in list stored in separate location, called the head or first Data type of each node depends on the specific application kind of data being processed link component of each node is a reference variable Data type of this reference variable is node type itself 7/26/2010 Malik D.S.
Image of page 6
L INKED L ISTS Structure of a node Structure of a linked list 7/26/2010 7 Malik D.S.
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.

{[ 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