Lecture 10 Doubly Linked List Sandy Ardianto & Erick Pranata © Sekolah Tinggi Teknik Surabaya 1
» Overview » InsertAfter » RemoveLast » Exercises 2 © Sekolah Tinggi Teknik Surabaya
» A doubly linked list is often more convenient than single linked list » Nodes store: ˃element ˃link to the previous node ˃link to the next node » Special trailer and header nodes 3 © Sekolah Tinggi Teknik Surabaya prevnext elem node trailer header nodes/positions elements
» We visualize operation insertAfter(p, X), which returns position q 4 © Sekolah Tinggi Teknik Surabaya ABXC ABC ABC p X q pq
» We visualize remove(p), where p == last() 5 © Sekolah Tinggi Teknik Surabaya ABCD p ABC D p ABC
» InsertFirst » InsertLast » RemoveFirst » Reverse » BubbleSort 6 © Sekolah Tinggi Teknik Surabaya