Algorithms and Data Structures · Middle · Question 48 of 75

How many subsets does a set of n elements have, and why does that matter?

Explanation

Each element is either in or out, giving 2ⁿ combinations. Backtracking that enumerates subsets is fine for n around 20 but not 50. n! is the number of permutations.

Further reading

Problem with a question

Algorithms and Data Structures · Middle · question 48

Test yourself

Take the Algorithms and Data Structures · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz