Maps, Hash tables, Skip Lists– Interesting problems

Slides:



Advertisements
Similar presentations
Hashing.
Advertisements

Lower bound for sorting, radix sort COMP171 Fall 2005.
© 2004 Goodrich, Tamassia Hash Tables1  
Lower bound for sorting, radix sort COMP171 Fall 2006.
Doubly Linked Lists1 © 2014 Goodrich, Tamassia, Goldwasser Presentation for use with the textbook Data Structures and Algorithms in Java, 6 th edition,
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.
CHAPTER 9 HASH TABLES, MAPS, AND SKIP LISTS ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++,
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,
CHAPTER 10 SEARCH TREES ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH, TAMASSIA AND.
PROGRAMMING 1 – REPORT ACKNOWLEDGEMENT: THE SLIDES ARE PREPARED FROM SLIDES PROVIDED BY NANCY M. AMATO AND JORY DENNY 1.
Hashing & Hash Tables. Sets/Dictionaries Set - Our best efforts to date:
CH 9 : MAPS AND DICTIONARIES 1 ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH, TAMASSIA.
CHAPTER 10.1 BINARY SEARCH TREES    1 ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS.
CSCE , SPRING 2016 INSTRUCTOR: DR. NANCY M. AMATO 1.
CH 1-4 : INTRODUCTION ACKNOWLEDGEMENT: THE SLIDES ARE PREPARED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++, GOODRICH, TAMASSIA AND.
1 What is it? A side order for your eggs? A form of narcotic intake? A combination of the two?
Chapter 11 Sorting Acknowledgement: These slides are adapted from slides provided with Data Structures and Algorithms in C++, Goodrich, Tamassia and Mount.
Hash Tables 1/28/2018 Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and M.
Sorted Maps © 2014 Goodrich, Tamassia, Goldwasser Skip Lists.
Skip Lists 5/10/2018 Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and M.
Binary Search Trees < > =
Sequences 6/3/2018 9:11 AM Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia,
Doubly Linked Lists 6/3/2018 Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia,
Hash Tables 6/13/2018 Presentation for use with the textbook Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015 Cuckoo Hashing.
Alternative method for dictionary building : Hashing
Bucket-Sort and Radix-Sort
CS 332: Algorithms Hash Tables David Luebke /19/2018.
Chapter 10.1 Binary Search Trees
Dictionaries Dictionaries 07/27/16 16:46 07/27/16 16:46 Hash Tables 
© 2013 Goodrich, Tamassia, Goldwasser
Hash Tables 3/25/15 Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and M.
Hash table another data structure for implementing a map or a set
Hash tables Hash table: a list of some fixed size, that positions elements according to an algorithm called a hash function … hash function h(element)
CS223 Advanced Data Structures and Algorithms
Advanced Associative Structures
Hash Tables in C Louis Manco.
Dictionaries and Their Implementations
Queues 12/3/2018 Queues © 2014 Goodrich, Tamassia, Goldwasser Queues.
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
CSE 373: Data Structures and Algorithms
v z Chapter 10 AVL Trees Acknowledgement: These slides are adapted from slides provided with Data Structures and Algorithms in C++, Goodrich,
Pointers And Memory Acknowledgement: THE Slides are Prepared FROM SLIDES PROVIDED By NANCY M. AMATO AND Jory Denny.
Chapter 13 Graph Algorithms
CSE 373 Data Structures and Algorithms
CSE 373: Data Structures and Algorithms
TREES– Interesting problems
Sparse matrices, hash tables, cell arrays
Week # 1: Overview & Review
Hash tables in C.
Noncomparison Based Sorting
Dictionaries 1/17/2019 7:55 AM Hash Tables   4
CH 9.2 : Hash Tables Acknowledgement: These slides are adapted from slides provided with Data Structures and Algorithms in C++, Goodrich, Tamassia and.
ITERATORS Acknowledgement: THE Slides are Prepared FROM SLIDES PROVIDED By NANCY M. AMATO AND Jory Denny.
Parasol Lab, Dept. CSE, Texas A&M University
Hashing Sections 10.2 – 10.3 Lecture 26 CS302 Data Structures
CH 9 : Maps And Dictionary
Lower bound for sorting, radix sort
Binary Search Trees < > =
Hash Tables By JJ Shepherd.
Hash Tables Buckets/Chaining
CS223 Advanced Data Structures and Algorithms
Extendable hashing M.B.Chandak.
Chapter 5: Hashing Hash Tables
CSE 373: Data Structures and Algorithms
Chapter 11 Sets, and Selection
Presentation transcript:

Maps, Hash tables, Skip Lists– Interesting problems Acknowledgement: These slides are adapted from slides provided with Data Structures and Algorithms in C++, Goodrich, Tamassia and Mount (Wiley 2004) and slides from Nancy M. Amato AND Jory Denny

Question 1 Consider a hash table with M slots. Suppose hash value is uniformly distributed between 1 to M, and it uses linked list to handle conflicts (if two keys hashed to the same slot). Suppose we put N keys into this M-slotted hash table, what is the probability that there will be a slot with i elements? i could vary from 0 to N.

Question 2 Remove duplicates in an array of numbers. You can use a second array or the same array, as the output array. 

Question 3 Print the actual phone number when given an alphanumeric phone number. For e.g. an input of 1-800-COM- CAST should give output as 18002662278 (note: output also does not contain any special characters like "-").