CH 9 : MAPS AND DICTIONARIES 1 ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH, TAMASSIA.

Slides:



Advertisements
Similar presentations
Skip List & Hashing CSE, POSTECH.
Advertisements

© 2004 Goodrich, Tamassia Hash Tables1  
© 2004 Goodrich, Tamassia Dictionaries   
© 2004 Goodrich, Tamassia Maps1. © 2004 Goodrich, Tamassia Maps2 A map models a searchable collection of key-value entries The main operations of a map.
Chapter 9: Maps, Dictionaries, Hashing Nancy Amato Parasol Lab, Dept. CSE, Texas A&M University Acknowledgement: These slides are adapted from slides provided.
9.3 The Dictionary ADT    … 01/25/98, Taipei, … 03/04/98, Yunlin, … 02/15/98, Douliou, … 01/20/98,
Dictionaries1 © 2010 Goodrich, Tamassia m l h m l h m l.
Maps. Hash Tables. Dictionaries. 2 CPSC 3200 University of Tennessee at Chattanooga – Summer 2013 © 2010 Goodrich, Tamassia.
Data Structures Lecture 13 Fang Yu Department of Management Information Systems National Chengchi University Fall 2010.
© 2004 Goodrich, Tamassia Skip Lists1  S0S0 S1S1 S2S2 S3S3    2315.
© 2004 Goodrich, Tamassia Dictionaries   
Dictionaries and Hash Tables1  
© 2004 Goodrich, Tamassia Binary Search Trees   
© 2004 Goodrich, Tamassia Maps1. © 2004 Goodrich, Tamassia Maps2 A map models a searchable collection of key-value entries The main operations of a map.
Data Structures Hash Table (aka Dictionary) i206 Fall 2010 John Chuang Some slides adapted from Marti Hearst, Brian Hayes, Andreas Veneris, Glenn Brookshear,
Skip Lists1 Skip Lists William Pugh: ” Skip Lists: A Probabilistic Alternative to Balanced Trees ”, 1990  S0S0 S1S1 S2S2 S3S3 
CS 221 Analysis of Algorithms Data Structures Dictionaries, Hash Tables, Ordered Dictionary and Binary Search Trees.
ADTs and C++ Ch 2,3,4 May 12, 2015 Abstract Data Type (ADT) An abstract data type is: 1.A collection of data items (storage structures) 2.Basic operations.
Hash Tables1   © 2010 Goodrich, Tamassia.
CS 221 Analysis of Algorithms Ordered Dictionaries and Search Trees.
LECTURE 36: DICTIONARY CSC 212 – Data Structures.
Maps and Dictionaries Data Structures and Algorithms CS 244 Brent M. Dingle, Ph.D. Department of Mathematics, Statistics, and Computer Science University.
Chapter 10: Search Trees Nancy Amato Parasol Lab, Dept. CSE, Texas A&M University Acknowledgement: These slides are adapted from slides provided with Data.
CH 6. VECTORS, LISTS, AND SEQUENCES ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH,
© 2004 Goodrich, Tamassia Hash Tables1  
CH 8. HEAPS AND PRIORITY QUEUES ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH, TAMASSIA.
CSC 212 – Data Structures Lecture 26: Hash Tables.
CH 7. TREES ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH, TAMASSIA AND MOUNT (WILEY.
CHAPTER 9 HASH TABLES, MAPS, AND SKIP LISTS ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++,
Map ADT by Dr. Bun Yue Professor of Computer Science CSCI 3333 Data Structures.
Maps & dictionaries Go&Ta A map models a searchable collection of key-value entries The main operations of a map are for searching, inserting,
1 i206: Lecture 12: Hash Tables (Dictionaries); Intro to Recursion Marti Hearst Spring 2012.
Hash Tables ADT Data Dictionary, with two operations – Insert an item, – Search for (and retrieve) an item How should we implement a data dictionary? –
CH 6 : VECTORS, LISTS AND SEQUENCES ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH,
CH 6 : VECTORS, LISTS AND SEQUENCES ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH,
CH 7 : TREE ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH, TAMASSIA AND MOUNT (WILEY.
CHAPTER 10 SEARCH TREES ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH, TAMASSIA AND.
CH 5 : STACKS, QUEUES, AND DEQUES ACKNOWLEDGEMENT: THE SLIDES ARE PREPARED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH, TAMASSIA.
Maps1 © 2010 Goodrich, Tamassia. Maps2  A map models a searchable collection of key-value entries  The main operations of a map are for searching, inserting,
CHAPTER 10.1 BINARY SEARCH TREES    1 ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS.
© 2004 Goodrich, Tamassia Maps1. © 2004 Goodrich, Tamassia Maps2 A map models a searchable collection of key-value entries The main operations of a map.
CSCE , SPRING 2016 INSTRUCTOR: DR. NANCY M. AMATO 1.
© 2004 Goodrich, Tamassia BINARY SEARCH TREES Binary Search Trees   
CH 1-4 : INTRODUCTION ACKNOWLEDGEMENT: THE SLIDES ARE PREPARED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH, TAMASSIA AND.
Lecture14: Hashing Bohyung Han CSE, POSTECH CSED233: Data Structures (2014F)
Chapter 11 Sorting Acknowledgement: These slides are adapted from slides provided with Data Structures and Algorithms in C++, Goodrich, Tamassia and Mount.
Maps, Hash tables, Skip Lists– Interesting problems
Chapter 10.1 Binary Search Trees
Dictionaries Dictionaries 07/27/16 16:46 07/27/16 16:46 Hash Tables 
Priority Queues © 2014 Goodrich, Tamassia, Goldwasser Priority Queues
Dictionaries < > = Dictionaries Dictionaries
Binary Search Trees < > =
Maps.
Dictionaries < > = /3/2018 8:58 AM Dictionaries
Ch. 8 Priority Queues And Heaps
CH 9.2 : Hash Tables Acknowledgement: These slides are adapted from slides provided with Data Structures and Algorithms in C++, Goodrich, Tamassia and.
Ordered Maps & Dictionaries
v z Chapter 10 AVL Trees Acknowledgement: These slides are adapted from slides provided with Data Structures and Algorithms in C++, Goodrich,
Dictionaries < > = /9/2018 3:06 AM Dictionaries
TREES– Interesting problems
Copyright © Aiman Hanna All rights reserved
"He's off the map!" - Eternal Sunshine of the Spotless Mind
CH 9.2 : Hash Tables Acknowledgement: These slides are adapted from slides provided with Data Structures and Algorithms in C++, Goodrich, Tamassia and.
Dictionaries < > = /17/2019 4:20 PM Dictionaries
Parasol Lab, Dept. CSE, Texas A&M University
Adaptable Priority Queues
CH 9 : Maps And Dictionary
Dictionaries < > = Dictionaries Dictionaries
Dictionaries and Hash Tables
Chapter 11 Sets, and Selection
Presentation transcript:

CH 9 : MAPS AND DICTIONARIES 1 ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH, TAMASSIA AND MOUNT (WILEY 2004) AND SLIDES FROM JORY DENNY AND MUKULIKA GHOSH

OUTLINE  Map ADT (Ch. 9.1)  Dictionary ADT (Ch. 9.5)  Ordered Map ADT (Ch. 9.3) 2

MAP  A map models a searchable collection of key-value pair (called entries)  Multiple items with the same key are not allowed  Often called “associative” containers  Applications:  address book or student records  mapping host names (e.g., cs16.net) to internet addresses (e.g., ) 3

MAP ADT 4

LIST-BASED MAP IMPLEMENTATION tail header nodes/positions entries 9 c 6 c 5 c 8 c 5

DIRECT ADDRESS TABLE MAP IMPLEMENTATION 6

DICTIONARY ADT (CH 9.5)  The dictionary ADT models a searchable collection of key-value entries  The main difference from a map is that multiple items with the same key are allowed  Any data structure that supports a dictionary also supports a map  Applications:  Dictionary which has multiple definitions for the same word 7

EXERCISE: DICTIONARY ADT 8

DICTIONARY ADT 9

ORDERED MAP/DICTIONARY ADT (CH 9.3)  An Ordered Map/Dictionary supports the usual map/dictionary operations, but also maintains an order relation for the keys.  Naturally supports  Ordered search tables - store dictionary in a vector by non-decreasing order of the keys  Utilizes binary search 10

EXAMPLE OF ORDERED MAP: BINARY SEARCH m l h m l h m l h l  m  h 11

MAP/DICTIONARY IMPLEMENTATIONS Space Unsorted list Direct Address Table (map only) Ordered Search Table (ordered map/dictionary) Space Unsorted list Direct Address Table (map only) Ordered Search Table (ordered map/dictionary) 12