MCPcopy Create free account
hub / github.com/ActiveState/code / fun

Function fun

recipes/Python/576659_/recipe-576659.py:35–49  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

33
34
35def fun(n):
36 if n==2:
37 return [[1,2],[2,1]]
38 else:
39 back=[]#返回集合
40
41 li_a=a(n)
42 for i in li_a:#依次取li_a中的每一个
43 li_c=c(i,li_a)#生成li_a中除去i的补集
44 for one in fun(n-1):#取下一级的所有排列序
45 #li=函数(第一位i,补集li_c,序数列表one)
46 li=form(i,li_c,one)
47 back.append(li)
48
49 return back
50
51
52

Callers 10

recipe-576659.pyFile · 0.70
fun_wrapperFunction · 0.50
runFunction · 0.50
__init__Method · 0.50
__init__Method · 0.50
__init__Method · 0.50
__workerThreadMethod · 0.50
_extractMethod · 0.50
innerFunction · 0.50
SolveEqFunction · 0.50

Calls 4

aFunction · 0.70
cFunction · 0.70
formFunction · 0.70
appendMethod · 0.45

Tested by

no test coverage detected