Presentation is loading. Please wait.

Presentation is loading. Please wait.

Doubly Linked Lists1 © 2014 Goodrich, Tamassia, Goldwasser Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition,

Similar presentations


Presentation on theme: "Doubly Linked Lists1 © 2014 Goodrich, Tamassia, Goldwasser Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition,"— Presentation transcript:

1 Doubly Linked Lists1 © 2014 Goodrich, Tamassia, Goldwasser Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition, by M. T. Goodrich, R. Tamassia, and M. H. Goldwasser, Wiley, 2014

2 Doubly Linked Lists2 Doubly Linked List  A doubly linked list can be traversed forward and backward  Nodes store: element link to the previous node link to the next node  Special trailer and header nodes prevnext element trailer header nodes/positions elements node © 2014 Goodrich, Tamassia, Goldwasser

3 Doubly Linked Lists3 Insertion  Insert a new node, q, between p and its successor. ABXC ABC p ABC p X q pq © 2014 Goodrich, Tamassia, Goldwasser

4 Doubly Linked Lists4 Deletion  Remove a node, p, from a doubly linked list. ABCD p ABC D p ABC © 2014 Goodrich, Tamassia, Goldwasser

5 Doubly-Linked List in Java © 2014 Goodrich, Tamassia, GoldwasserDoubly Linked Lists5

6 Doubly-Linked List in Java, 2 © 2014 Goodrich, Tamassia, GoldwasserDoubly Linked Lists6

7 Doubly-Linked List in Java, 3 © 2014 Goodrich, Tamassia, GoldwasserDoubly Linked Lists7

8 Doubly-Linked List in Java, 4 © 2014 Goodrich, Tamassia, GoldwasserDoubly Linked Lists8


Download ppt "Doubly Linked Lists1 © 2014 Goodrich, Tamassia, Goldwasser Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition,"

Similar presentations


Ads by Google