This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ECE 2574 Introduction to Data Structures and Algorithms Lecture 20: Introduction to Dictionaries (Tables) Reading: Chapter 11 Chris Wyatt Electrical and Computer Engineering and School of Biomedical Engineering and Sciences Virginia Tech Monday Outline
Examples of Dictionaries/Tables Table ADT Table Implementations Review for Exam 2 Dictionary (Table)
Example 1: Example 2: Table ADT
items are a collection, one of which is the key Insert, delete, and retrieve use the key What can keys be?
Numbers: integer or real Strings Generic objects? Anything we can define ordering for (< = >) Table assumes keys are unique?
Why? What constraints does this place on its usage? What does a table with multiple identical keys look like? Dictionary implementations
Linear unsorted array sorted array unsorted linked list sorted linked list Nonlinear binary search trees
Complexity insert retrieve delete traverse Binary search tree implementation
Denote one of the table columns as the tree. - must be unique - must be a valid key (<, =, > defined) How in C++ do we allow the user of our dictionary to define the record? ...
View Full Document