A set is an Abstract Data Type used in programming languages.

  • Union: Join a set and keep all common elements
  • Intersection: Just keep common elements between two sets

Anki

id: set-definition deck: Computer Science::Data Structures tags: data-structures set

Q: What happens if you add the same value to a set twice? A: The set still stores only one copy of that value.

id: set-union-intersection deck: Computer Science::Data Structures tags: data-structures set

Q: If one set contains {1, 2} and another contains {2, 3}, what is their intersection? A: {2}, because 2 is the only value present in both sets.