Click or drag to resize

editDistanceEditDistanceT Method

Gets the minimum number of edit steps to transform this to other.

Namespace:  WhetStone.Looping
Assembly:  WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntax
C#
public static int EditDistance<T>(
	this IEnumerable<T> this,
	IEnumerable<T> other,
	IEqualityComparer<T> comp = null,
	bool allowIns = true,
	bool allowDel = true,
	bool allowSub = true
)

Parameters

this
Type: System.Collections.GenericIEnumerableT
The starting IEnumerableT.
other
Type: System.Collections.GenericIEnumerableT
The destination IListT.
comp (Optional)
Type: System.Collections.GenericIEqualityComparerT
The IEqualityComparerT to compare elements. Setting to .
allowIns (Optional)
Type: SystemBoolean
Whether to allow insertions.
allowDel (Optional)
Type: SystemBoolean
Whether to allow deletions.
allowSub (Optional)
Type: SystemBoolean
Whether to allow substations.

Type Parameters

T
The type of this and other's elements.

Return Value

Type: Int32
The number of steps in the minimum edit path from this to other.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks

Using forgetful dynamic programming, time complexity O(n^2), space complexity O(n).

See Also