Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
1
Task/Permutations/Julia/permutations-1.julia
Normal file
1
Task/Permutations/Julia/permutations-1.julia
Normal file
|
|
@ -0,0 +1 @@
|
|||
julia> perms(l) = isempty(l) ? [l] : [[x; y] for x in l for y in perms(setdiff(l, x))]
|
||||
7
Task/Permutations/Julia/permutations-2.julia
Normal file
7
Task/Permutations/Julia/permutations-2.julia
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
julia> perms([1,2,3])
|
||||
6-element Vector{Vector{Int64}}:
|
||||
[1, 2, 3]
|
||||
[1, 3, 2]
|
||||
⋮
|
||||
[3, 1, 2]
|
||||
[3, 2, 1]
|
||||
14
Task/Permutations/Julia/permutations-3.julia
Normal file
14
Task/Permutations/Julia/permutations-3.julia
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
using Combinatorics
|
||||
|
||||
term = "RCode"
|
||||
i = 0
|
||||
pcnt = factorial(length(term))
|
||||
print("All the permutations of ", term, " (", pcnt, "):\n ")
|
||||
for p in permutations(split(term, ""))
|
||||
global i
|
||||
print(join(p), " ")
|
||||
i += 1
|
||||
i %= 12
|
||||
i != 0 || print("\n ")
|
||||
end
|
||||
println()
|
||||
2
Task/Permutations/Julia/permutations-4.julia
Normal file
2
Task/Permutations/Julia/permutations-4.julia
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# Generate all permutations of size t from an array a with possibly duplicated elements.
|
||||
collect(Combinatorics.multiset_permutations([1,1,0,0,0],3))
|
||||
Loading…
Add table
Add a link
Reference in a new issue