Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
{def lcs
|
||||
{def lcs.rec
|
||||
{lambda {:a :b :w}
|
||||
{if {or {< {W.length :a} 2} {< {W.length :b} 2} }
|
||||
then {W.rest :w}
|
||||
else {if {W.equal? {W.first :a} {W.first :b}}
|
||||
then {lcs.rec {W.rest :a} {W.rest :b} :w{W.first :a}}
|
||||
else {let { {:x {lcs.rec :a {W.rest :b} :w}}
|
||||
{:y {lcs.rec {W.rest :a} :b :w}}
|
||||
} {if {> {W.length :x} {W.length :y}}
|
||||
then :x
|
||||
else :y} }}}}}
|
||||
{lambda {:a :b}
|
||||
{lcs.rec :a# :b# #}}}
|
||||
-> lcs
|
||||
|
||||
{lcs testing123testing thisisatest}
|
||||
-> tsitest // 23000ms
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{jslcs testing123testing thisisatest}
|
||||
-> tsitest // 130ms
|
||||
|
||||
{script
|
||||
// the lcs function code is in the javascript entry
|
||||
|
||||
LAMBDATALK.DICT["jslcs"] = function() {
|
||||
var args = arguments[0].split(" ");
|
||||
return lcs( args[0], args[1] )
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue