September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -0,0 +1,33 @@
|
|||
bool countonly = false
|
||||
integer count = 0
|
||||
|
||||
procedure ncs(sequence rest, integer ri=0, sequence taken={}, bool contig=false, bool gap=false)
|
||||
if ri>=length(rest) then
|
||||
if contig then
|
||||
if countonly then
|
||||
count += 1
|
||||
else
|
||||
?taken
|
||||
end if
|
||||
end if
|
||||
else
|
||||
ri += 1
|
||||
ncs(rest,ri,taken&rest[ri],gap,gap)
|
||||
ncs(rest,ri,taken,contig,length(taken)!=0)
|
||||
end if
|
||||
end procedure
|
||||
|
||||
ncs({1,2,3})
|
||||
?"==="
|
||||
ncs({1,2,3,4})
|
||||
?"==="
|
||||
countonly = true
|
||||
atom t0 = time()
|
||||
sequence s = {}
|
||||
for i=1 to 20 do
|
||||
count = 0
|
||||
ncs(tagset(i))
|
||||
s = append(s,count)
|
||||
end for
|
||||
?time()-t0
|
||||
?s
|
||||
Loading…
Add table
Add a link
Reference in a new issue