Subsets

In this blog post, I will be giving a brief introduction about another important pattern for technical interview. This pattern is called Subsets.This pattern is very useful to solve problems that involve dealing with Permutations and Combinations of a given set of elements. This data structure pattern describes an efficient Breadth First Search approach to handle all the problems.

The pattern looks like this;

Let assume that we are given a set of [1,9,2]

  1. First step , we start with an empty set :[[]]

References:

--

--

Student at Flatiron School

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store