Download presentation
Presentation is loading. Please wait.
Published bySuparman Budiman Modified over 5 years ago
1
Doubly linked lists Idea: same as singly linked list, but each node also points to the previous: Can optionally also have a pointer to the tail, so we can start scanning from the end, and make appending easier Also helps with binary search
2
Inserting into a DLL Find node before the new one, nextNode
Set newNode.prev = nextNode.prev Set newNode.prev.next = newNode Set newNode.next = nextNode Set nextNode.prev = newNode
3
Queues Main idea: similar to a stack, but use “First in, first out” methodology ”Push” and “Pop” now become “enqueue” and “dequeue” Primary stipulation: dequeue returns the least-recently enqueued item
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.