hanugm
hanugm

Reputation: 1417

Permutations with repetitions

Is there any inbuilt function in Julia language that permutes a given list with repetitions

There are n^n such permutations for a list of n elements

Upvotes: 2

Views: 1037

Answers (1)

Harlan
Harlan

Reputation: 19401

Not entirely sure what you're asking for, but the cartesian product iterator in the Iterators.jl package might be along those lines.

https://github.com/JuliaLang/Iterators.jl/blob/master/src/Iterators.jl#L204

(Not inbuilt, if that matters to you for some reason. Also, Iterators.jl could use better documentation...)

Upvotes: 3

Related Questions