1 / 4

Variations of Linked Lists

Variations of Linked Lists. CS 308 – Data Structures. Problems with singly connected lists. Given a node, we can access only nodes that follow it but not nodes that precede it. We cannot delete a node, given only one a pointer to that node ( location )

tuvya
Download Presentation

Variations of Linked Lists

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Variations of Linked Lists CS 308 – Data Structures

  2. Problems with singly connected lists • Given a node, we can access only nodes that follow it but not nodes that precede it. • We cannot delete a node, given only one a pointer to that node (location) • To access the last element of the list, we must traverse the whole list • We cannot traverse the list in reverse

  3. Circular Linked Lists • Extending a linear linked list to a circular linked list • Make the last node point back to the first node

  4. Extending a linear linked list to a circular linked list (cont.) • To have access to both the first and last nodes of the list, make listData point to the last node

More Related