2/19/2016 3:18 PMSkip Lists1 S0S0 S1S1 S2S2 S3S3 103623 15 2315.
Doubly Linked Lists1 © 2014 Goodrich, Tamassia, Goldwasser Presentation for use with the textbook...
-
Upload
augustine-tyler -
Category
Documents
-
view
233 -
download
4
Transcript of Doubly Linked Lists1 © 2014 Goodrich, Tamassia, Goldwasser Presentation for use with the textbook...
![Page 1: Doubly Linked Lists1 © 2014 Goodrich, Tamassia, Goldwasser Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649d6e5503460f94a4fce6/html5/thumbnails/1.jpg)
Doubly Linked Lists 1
Doubly Linked Lists
© 2014 Goodrich, Tamassia, Goldwasser
Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and M. H. Goldwasser, Wiley, 2014
![Page 2: Doubly Linked Lists1 © 2014 Goodrich, Tamassia, Goldwasser Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649d6e5503460f94a4fce6/html5/thumbnails/2.jpg)
Doubly Linked Lists 2
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
prev next
element
trailerheader nodes/positions
elements
node
© 2014 Goodrich, Tamassia, Goldwasser
![Page 3: Doubly Linked Lists1 © 2014 Goodrich, Tamassia, Goldwasser Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649d6e5503460f94a4fce6/html5/thumbnails/3.jpg)
Doubly Linked Lists 3
Insertion Insert a new node, q, between p and its successor.
A B X C
A B C
p
A B C
p
X
q
p q
© 2014 Goodrich, Tamassia, Goldwasser
![Page 4: Doubly Linked Lists1 © 2014 Goodrich, Tamassia, Goldwasser Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649d6e5503460f94a4fce6/html5/thumbnails/4.jpg)
Doubly Linked Lists 4
Deletion Remove a node, p, from a doubly linked list.
A B C D
p
A B C
D
p
A B C© 2014 Goodrich, Tamassia, Goldwasser
![Page 5: Doubly Linked Lists1 © 2014 Goodrich, Tamassia, Goldwasser Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649d6e5503460f94a4fce6/html5/thumbnails/5.jpg)
Doubly-Linked List in Java
© 2014 Goodrich, Tamassia, Goldwasser Doubly Linked Lists 5
![Page 6: Doubly Linked Lists1 © 2014 Goodrich, Tamassia, Goldwasser Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649d6e5503460f94a4fce6/html5/thumbnails/6.jpg)
Doubly-Linked List in Java, 2
© 2014 Goodrich, Tamassia, Goldwasser Doubly Linked Lists 6
![Page 7: Doubly Linked Lists1 © 2014 Goodrich, Tamassia, Goldwasser Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649d6e5503460f94a4fce6/html5/thumbnails/7.jpg)
Doubly-Linked List in Java, 3
© 2014 Goodrich, Tamassia, Goldwasser Doubly Linked Lists 7
![Page 8: Doubly Linked Lists1 © 2014 Goodrich, Tamassia, Goldwasser Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649d6e5503460f94a4fce6/html5/thumbnails/8.jpg)
Doubly-Linked List in Java, 4
© 2014 Goodrich, Tamassia, Goldwasser Doubly Linked Lists 8