Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,4 @@
|
|||
bfsjt0=: _1 - i.
|
||||
lookingat=: 0 >. <:@# <. i.@# + *
|
||||
next=: | >./@:* | > | {~ lookingat
|
||||
bfsjtn=: (((] <@, ] + *@{~) | i. next) C. ] * _1 ^ next < |)^:(*@next)
|
||||
16
Task/Permutations-by-swapping/J/permutations-by-swapping-2.j
Normal file
16
Task/Permutations-by-swapping/J/permutations-by-swapping-2.j
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
bfsjtn^:(i.!3) bfjt0 3
|
||||
_1 _2 _3
|
||||
_1 _3 _2
|
||||
_3 _1 _2
|
||||
3 _2 _1
|
||||
_2 3 _1
|
||||
_2 _1 3
|
||||
<:@| bfsjtn^:(i.!3) bfjt0 3
|
||||
0 1 2
|
||||
0 2 1
|
||||
2 0 1
|
||||
2 1 0
|
||||
1 2 0
|
||||
1 0 2
|
||||
A. <:@| bfsjtn^:(i.!3) bfjt0 3
|
||||
0 1 4 5 3 2
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
(_1^2|i.!3),. bfsjtn^:(i.!3) bfjt0 3
|
||||
1 _1 _2 _3
|
||||
_1 _1 _3 _2
|
||||
1 _3 _1 _2
|
||||
_1 3 _2 _1
|
||||
1 _2 3 _1
|
||||
_1 _2 _1 3
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
(,.~C.!.2)<:| bfsjtn^:(i.!3) bfjt0 3
|
||||
1 0 1 2
|
||||
_1 0 2 1
|
||||
1 2 0 1
|
||||
_1 2 1 0
|
||||
1 1 2 0
|
||||
_1 1 0 2
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
rsjt=: 3 :0
|
||||
if. 2>y do. i.2#y
|
||||
else. ((!y)$(,~|.)-.=i.y)#inv!.(y-1)"1 y#rsjt y-1
|
||||
end.
|
||||
)
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
(,.~ C.!.2) rsjt 3
|
||||
1 0 1 2
|
||||
_1 0 2 1
|
||||
1 2 0 1
|
||||
_1 2 1 0
|
||||
1 1 2 0
|
||||
_1 1 0 2
|
||||
Loading…
Add table
Add a link
Reference in a new issue