Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xotic750/power-set-x
Calculates the Power Set of a set S. http://en.wikipedia.org/wiki/Power_set
https://github.com/xotic750/power-set-x
browser ecmascript nodejs powerset
Last synced: 4 days ago
JSON representation
Calculates the Power Set of a set S. http://en.wikipedia.org/wiki/Power_set
- Host: GitHub
- URL: https://github.com/xotic750/power-set-x
- Owner: Xotic750
- License: mit
- Created: 2015-12-22T05:32:48.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T23:31:30.000Z (about 2 years ago)
- Last Synced: 2024-12-18T08:06:35.445Z (about 1 month ago)
- Topics: browser, ecmascript, nodejs, powerset
- Language: JavaScript
- Homepage:
- Size: 3.38 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## power-set-x
Calculates the Power Set of a set S.
### `module.exports(value)` ⇒
Array.<Array>
⏏This method calculates the Power Set of `value`. Array sparseness is
ignored.In mathematics, the power set (or powerset) of any set S,
written P(S), ℘(S), P(S), ℙ(S) or 2S, is the set of all subsets of S,
including the empty set and S itself.**Kind**: Exported function
**Returns**:Array.<Array>
- The power set of `value`.
**See**: http://en.wikipedia.org/wiki/Power_set| Param | Type | Description |
| ----- | ------------------ | ----------------------------------------------- |
| value |Array
| The array like `value` to get the power set of. |**Example**
```js
import powerSet from 'power-set-x';console.log(powerSet([1, 2, 3])); // [[], [3], [2], [2, 3], [1], [1, 3], [1, 2], [1, 2, 3]]
```