From 2f329b012a764ea67249c2c0802093f672b1663e Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Mon, 2 Apr 2018 08:57:42 +0300 Subject: [PATCH] Add cartesian product algorithm. --- src/algorithms/math/cartesian-product/README.md | 8 ++++++++ .../math/cartesian-product/cartesian-product.js | 1 + 2 files changed, 9 insertions(+) create mode 100644 src/algorithms/math/cartesian-product/README.md create mode 100644 src/algorithms/math/cartesian-product/cartesian-product.js diff --git a/src/algorithms/math/cartesian-product/README.md b/src/algorithms/math/cartesian-product/README.md new file mode 100644 index 00000000..cfcf806e --- /dev/null +++ b/src/algorithms/math/cartesian-product/README.md @@ -0,0 +1,8 @@ +# Cartesian Product + +In set theory a Cartesian product is a mathematical operation that returns a set +(or product set or simply product) from multiple sets. That is, for sets A and B, +the Cartesian product A × B is the set of all ordered pairs (a, b) +where a ∈ A and b ∈ B. + +![Cartesian Product of Two Sets](https://en.wikipedia.org/wiki/Cartesian_product#/media/File:Cartesian_Product_qtl1.svg) diff --git a/src/algorithms/math/cartesian-product/cartesian-product.js b/src/algorithms/math/cartesian-product/cartesian-product.js new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/src/algorithms/math/cartesian-product/cartesian-product.js @@ -0,0 +1 @@ +