lec16 - Dictionaries Collection of items. Each item is a...

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

View Full Document Right Arrow Icon
Dictionaries Collection of items. Each item is a pair. (key, element) Pairs have different keys.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Application Collection of student records in this class. (key, element) = (student name, linear list of assignment and exam scores) All keys are distinct. Collection of in-use domain names. (godaddy.com, owner information) All keys are distinct.
Background image of page 2
Dictionary With Duplicates Keys are not required to be distinct. Word dictionary. Pairs are of the form (word, meaning) . May have two or more entries for the same word. (bolt, a threaded pin) (bolt, a crash of thunder) (bolt, to shoot forth suddenly) (bolt, a gulp) (bolt, a standard roll of cloth) etc.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Dictionary Operations Static Dictionary. initialize/create get(theKey) (a.k.a. search ) CD ROM word dictionary CD ROM geographic database of cities, rivers, roads, auto navigation system, etc. Dynamic Dictionary. get(theKey) (a.k.a. search ) put(theKey, theElement) (a.k.a. insert ) remove(theKey) (a.k.a. delete )
Background image of page 4
Hash Table Dictionaries O(1) expected time for get , put , and remove . O(n)
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/07/2010 for the course COT 5536 taught by Professor Sartajsahani during the Spring '10 term at University of Florida.

Page1 / 27

lec16 - Dictionaries Collection of items. Each item is a...

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

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