Lecture_11_-_mix&match_-_1_slide_per_page

Lecture_11_-_mix&match_-_1_slide_per_page -...

Info iconThis preview shows pages 1–17. Sign up to view the full content.

View Full Document Right Arrow Icon
NUS CS1102 Data Structures with Multiple Organization
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
NUS CS1102 Basic Data Structures b Array b Linked List b Trees
Background image of page 2
NUS CS1102 Mix-and-Match 1 b Array of Linked-List 3 2 1
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
NUS CS1102 Mix-and-Match 2 b Binary Search Tree + Linked-List 5 4 8 7 1 3 9 2
Background image of page 4
NUS CS1102 More Examples b Need an ADT for s enqueue(item) s dequeue(item) s peek() s printInOrder()
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
NUS CS1102 Use a Queue O(N log N) printInOrder () O(1) peek () O(1) dequeue () O(1) enqueue (item)
Background image of page 6
NUS CS1102 Use a Sorted Linked List O(N) printInOrder () ? peek () ? dequeue () ? enqueue (item)
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
NUS CS1102 Use both 3 5 8 9 8 3 9 5 Queue Sorted List
Background image of page 8
NUS CS1102 Enqueue(6) 3 5 8 9 8 3 9 5 Queue Sorted List 6 6
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
NUS CS1102 Dequeue() 3 5 8 9 8 3 9 5 Queue Sorted List 6 6
Background image of page 10
NUS CS1102 Use Queue and Linked List O(N) printInOrder () O(1) peek () O(N) dequeue () O(N) enqueue (item)
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
NUS CS1102
Background image of page 12
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 14
Background image of page 15

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 16
Background image of page 17
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Improvement 8 3 9 5 Queue Pointer List Pointer List Head NUS CS1102 Combine Queue and Linked List O(N) printInOrder () O(1) peek () O(1) dequeue () O(N) enqueue (item) NUS CS1102 More Improvement 8 3 9 5 Queue Pointer Left Pointer Root Right Pointer NUS CS1102 Combine Queue and BST O(N) printInOrder () O(1) peek () O(1) dequeue () O(log N) enqueue (item) NUS CS1102 Combine Queue and BST O(N) printInOrder () O(1) peek () O(1) (how??) dequeue () O(log N) enqueue (item) NUS CS1102 More Improvement 8 3 9 5 Queue Pointer Left Pointer Root Right Pointer Succ/Pred Pointer...
View Full Document

This note was uploaded on 12/02/2011 for the course CS 3211 taught by Professor Dunnowho during the Spring '11 term at National University of Singapore.

Page1 / 17

Lecture_11_-_mix&match_-_1_slide_per_page -...

This preview shows document pages 1 - 17. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online