Skip to content

Commit 3baf88c

Browse files
committedDec 11, 2018
Add PowerSet binary solution example.
1 parent 3844e9f commit 3baf88c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎src/algorithms/sets/power-set/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ what we need: it shows by its bits (`0` or `1`) whether to include related
4747
element from the set or not. For example, for the set `{1, 2, 3}` the binary
4848
number of `0b010` would mean that we need to include only `2` to the current set.
4949

50+
| | `abc` | Subset |
51+
| :---: | :---: | :-----------: |
52+
| `0` | `000` | `{}` |
53+
| `1` | `001` | `{c}` |
54+
| `2` | `010` | `{b}` |
55+
| `3` | `011` | `{c, b}` |
56+
| `4` | `100` | `{a}` |
57+
| `5` | `101` | `{a, c}` |
58+
| `6` | `110` | `{a, b}` |
59+
| `7` | `111` | `{a, b, c}` |
60+
5061
> See [bwPowerSet.js](./bwPowerSet.js) file for bitwise solution.
5162
5263
### Backtracking Solution

0 commit comments

Comments
 (0)
Please sign in to comment.