© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
T. MailundIntroduction to Computational Thinkinghttps://doi.org/10.1007/978-1-4842-7077-6_14

14. Sets

Thomas Mailund1  
(1)
Aarhus N, Denmark
 

Conceptually, sets are simpler than sequences. The reason we took sequences first, though, is that we can implement sets in different ways to make operations more efficient, and some of these implementations are more complicated than the linked list data structure we made in the previous chapter.

There are many operations we might want for a set, for example, computing the union or intersection of two sets, but we will stick to the minimal interface we would expect a set to have. We want to be able to add elements to a ...

Get Introduction to Computational Thinking: Problem Solving, Algorithms, Data Structures, and More now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.