Show / Hide Table of Contents

Class TreeEqualityComparer<T>

Equality comparer for generic trees.

Inheritance
System.Object
TreeEqualityComparer<T>
Implements
System.Collections.Generic.IEqualityComparer<ITree<T>>
Namespace: System.Linq.CompilerServices
Assembly: Nuqleon.Linq.CompilerServices.dll
Syntax
public class TreeEqualityComparer<T> : Object, IEqualityComparer<ITree<T>>
Type Parameters
Name Description
T

Tree node type.

Constructors

TreeEqualityComparer()

Creates a new tree equality comparer using the default comparer for tree node values.

Declaration
public TreeEqualityComparer()

TreeEqualityComparer(IEqualityComparer<T>)

Creates a new tree equality comparer using the specified comparer for tree node values.

Declaration
public TreeEqualityComparer(IEqualityComparer<T> comparer)
Parameters
Type Name Description
System.Collections.Generic.IEqualityComparer<T> comparer

Equality comparer for tree node values.

Methods

Equals(ITree<T>, ITree<T>)

Checks whether two trees are equal.

Declaration
public bool Equals(ITree<T> x, ITree<T> y)
Parameters
Type Name Description
ITree<T> x

First tree to compare.

ITree<T> y

Second tree to compare.

Returns
Type Description
System.Boolean

true if both trees are equal; otherwise, false.

GetHashCode(ITree<T>)

Gets a hash code representation of the specified tree.

Declaration
public int GetHashCode(ITree<T> obj)
Parameters
Type Name Description
ITree<T> obj

Tree to get a hash code representation for.

Returns
Type Description
System.Int32

Hash code for the specified tree.

Implements

System.Collections.Generic.IEqualityComparer<>
In This Article
Back to top Generated by DocFX