
Overview
Sets are a simple, nifty little data structure. They’re similar to arrays with one key difference: They only hold unique values.
Prerequisites
- Big O Notation
- Linked Lists
Learning Objectives
By the end of this module, learners will be able to:
- Define a set and how it’s used in programming.
- Distinguish between a set, an array, and a linked list.
- Implement a set and common methods used in sets.
Content
There are two components to this module:
- Lesson: Sets
- Exercise: Implementing a Set
Solution Code
Time to Complete
1.5 hours total:
- 0.5 hour - Sets Lesson
- 1 hour - Implementing a Set Exercise
Additional Resources
- The great set vs. array debate: An article discussing when to use sets versus arrays.
- We talk about sets in JavaScript, but they’re also a pretty common object in Python. Read more about how they’re used here: A detailed explanation of sets in Python.
- An in-depth overview of sets in JavaScript: A comprehensive guide to sets in JavaScript.
Internal resources
✏️ Instructor Guide
🏗️ Release Notes
Find a 👾 bug 👾 or have suggestions? Let us know!