python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Efficiently generating the cartesian product of lists with > 50 elements
I am trying to generate all possible combinations from a list over 50 elements, I was working in a previous implementation with this function:
let rec extract k list =
if k <= 0 then [ [] ]
els...

CGeorgi
Votes: 0
Answers: 1
N-ary cartesian product of variadic templates
I am trying to compute the n-ary cartesian product of variadic templates and so far I haven't found an elegant method for the n-ary case (unary and binary are easy, see below).
Here is the current st...

Vincent
Votes: 0
Answers: 1
How do I iterate through two Sets in Clojure in order to return their Cartesian product?
So I take in two Sets and wanna iterate through them in order to return a new set containing the cross product of the two sets.
(defn cartesian
"computes Cartesian product of A and B"
[...

Tarmiac
Votes: 0
Answers: 2
Cartesian product for an array of json objects
How can I produce all of the combinations of the values in an array of the of Objects.
var input = [
{ "colour" : "red",
"material" : "cotton" ,
...
ekimuli Dee
Votes: 0
Answers: 1