Exercises in this lecture  previous -- Keyboard shortcut: 'p'  next -- Keyboard shortcut: 'n'  Go to the slide, where this exercise belongs -- Keyboard shortcut: 'u'  

Exercise 2.23
Powerset **


Program a function powerset, which as input takes a set S (represented as a list). The function must return all possible subsets of S.

Hint: What is (powerset '())? It should, of course, be a set of sets. Each set is a represented as a list.


Solution