Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am Nayruden on github.
  • I am brettsmith (https://keybase.io/brettsmith) on keybase.
  • I have a public key whose fingerprint is A38C 1A8F EE30 D034 3D1C 7B88 7E3F 1D1F 1A24 63F6

To claim this, I am signing this object:

-- This code is available online at http://bit.ly/baas-compare
function sort( N ) -- Remember N is one indexed
if N[ 1 ] > N[ 2 ] then -- One comparison
N[ 1 ], N[ 2 ] = N[ 2 ], N[ 1 ]
end
if N[ 3 ] > N[ 4 ] then -- Two comparisons
N[ 3 ], N[ 4 ] = N[ 4 ], N[ 3 ]
end
--[[
Function: EditDistance
Finds the edit distance between two strings or tables. Edit distance is the minimum number of
edits needed to transform one string or table into the other.
Parameters:
s - A *string* or *table*.
t - Another *string* or *table* to compare against s.
using System;
using System.Collections.Generic;
using System.Collections;
public class Slice<T> : IList<T>
{
private IList<T> backing_array;
private readonly int start;
private readonly int _count;