Learn how to store a unique collection of items with a set and discover when the set data structure is most useful. Discover how a set is implemented with a hash table.
- Another way we can structure our data is with a set.…Similar to linked lists, hash maps,…and other data structures, a set is an abstract data type.…It's an idea that can be implemented in many different ways.…In the simplest of terms, a set is a collection…of unique items.…The order of these items doesn't matter,…but none of the elements are duplicated.…So why would we want to keep track of data in this way?…Well, sets are a way of grouping things…with a common property.…
For example, you might create a set that represents…types of clothing you can wear,…or a set with three primary colors.…You could also create a set that represents…the names of the fingers we have.…Think pinky, ring, middle, and index.…Unlike the other data structures we've seen,…here we don't care about the order of the elements,…and often, we don't even want to retrieve a piece of data.…That's why we don't have an index, or key,…or anything specific to look up the value.…
Here, we care about membership.…With sets, we are usually testing if a piece of data…
- Data types: Booleans, numbers, strings, and more
- Multidimensional arrays
- Jagged arrays
- Search and sort arrays
- Linked lists
- Stacks and queues
- Hash functions and hash tables
- Trees and graphs
Skill Level Intermediate
Understand data structures1m 25s
1. Introduction to Data Structures
4. Stacks and Queues
5. Hash-Based Data Structures
6. Trees and Graphs
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.