Skip to content

Instantly share code, notes, and snippets.

View abarth500's full-sized avatar

Shohei Yokoyama abarth500

  • Tokyo Metropolitan University
  • Tokyo Japan
View GitHub Profile
@abarth500
abarth500 / lcs.js
Last active January 17, 2018 08:32 — forked from greduan/lcs.js
LCS algorithm in JS. Prettified version of what can be found here: https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_subsequence#JavaScript
// prettified version of what can be found here:
// https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_subsequence#JavaScript
function LCS(a, b) {
var m = a.length,
n = b.length,
C = [],
i,
j;
for (i = 0; i <= m; i++) C.push([0]);
// AVLTree ///////////////////////////////////////////////////////////////////
// This file is originally from the Concentré XML project (version 0.2.1)
// Licensed under GPL and LGPL
//
// Modified by Jeremy Stephens.
// Pass in the attribute you want to use for comparing
function AVLTree(n, attr) {
this.init(n, attr);
}