Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
define ncsubseq(l);
|
||||
lvars acc = [], gap_started = false, is_continuous = true;
|
||||
define do_it(l1, l2);
|
||||
dlocal gap_started;
|
||||
lvars el, save_is_continuous = is_continuous;
|
||||
if l2 = [] then
|
||||
if not(is_continuous) then
|
||||
cons(l1, acc) -> acc;
|
||||
endif;
|
||||
else
|
||||
front(l2) -> el;
|
||||
back(l2) -> l2;
|
||||
not(gap_started) and is_continuous -> is_continuous;
|
||||
do_it(cons(el, l1), l2);
|
||||
save_is_continuous -> is_continuous;
|
||||
not(l1 = []) or gap_started -> gap_started;
|
||||
do_it(l1, l2);
|
||||
endif;
|
||||
enddefine;
|
||||
do_it([], rev(l));
|
||||
acc;
|
||||
enddefine;
|
||||
|
||||
ncsubseq([1 2 3 4 5]) =>
|
||||
Loading…
Add table
Add a link
Reference in a new issue