Download presentation
Presentation is loading. Please wait.
Published byOpal McGee Modified over 8 years ago
1
Lecture 6 Data Structures
2
Stack top
3
2 2 4 4 6 6 8 8 9 9x
4
2 2 4 4 6 6 8 8 9 9x
5
Queue 13 5 62 head tail
6
1 1 2 2 3 3x
7
1 1 2 2 3 3 head x
8
Priority Queue A priority queue is a data structure for maintaining a set of elements, each with an associated value, called a key. A max-priority queue supports the following operations: Insert(S,x), Maximum(S), Extract-Max(S), Increase-Key(S,x,k). Max-Heap can be used for implementing max-priority queue.
13
Doubly Linked List 12 3 prevkeynext
14
1 12 x x is an object!!!
15
1 12 x 32
16
Sentinel A sentinel is a dummy object that allow us to simplify the boundary condition. With sentinel, a doubly linked list can be turned into a circular one. The sentinel nil[L] is placed between the head and the tail.
18
Direct Addressing Direct addressing is a simple technique that work well when the universe of keys is reasonably small. Direct-address table is an array in which each position, or slot, corresponds to a key in the universe. If the universe is large, how to do? Hashing!
19
Hash Table Collision resolution by chaining
20
Hash Functions
21
What we learnt in this lecture? Review elementary data structures
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.