Download presentation
Presentation is loading. Please wait.
Published byAugustine Tyler Modified over 9 years ago
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
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.