skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class BinarySearchTreeBase<T>

Base implementation of the ISearchTree<T> interface.

Inheritance
System.Object
BinarySearchTreeBase<T>
RedBlackTree<T>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.WinControls.RadDiagram.dll

Syntax

public abstract class BinarySearchTreeBase<T> : ISearchTree<T>, ICollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
T

The data type contained in this collection.

Constructors

BinarySearchTreeBase()

Initializes a new instance of the BinarySearchTreeBase<T> class.

Declaration
protected BinarySearchTreeBase()

BinarySearchTreeBase(IComparer<T>)

Initializes a new instance of the BinarySearchTreeBase<T> class.

Declaration
protected BinarySearchTreeBase(IComparer<T> comparer)
Parameters
System.Collections.Generic.IComparer<T> comparer

The comparer to use when comparing items.

Exceptions
System.ArgumentNullException

comparer is a null reference (Nothing in Visual Basic).

BinarySearchTreeBase(Comparison<T>)

Initializes a new instance of the BinarySearchTreeBase<T> class.

Declaration
protected BinarySearchTreeBase(Comparison<T> comparison)
Parameters
System.Comparison<T> comparison

The comparison.

Properties

Comparer

Gets the comparer.

Declaration
public IComparer<T> Comparer { get; }
Property Value
System.Collections.Generic.IComparer<T>

The comparer.

Count

Gets the count.

Declaration
public int Count { get; }
Property Value
System.Int32

Implements
System.Collections.Generic.ICollection<T>.Count

Height

Gets the height.

Declaration
public int Height { get; }
Property Value
System.Int32

IsEmpty

Gets a value indicating whether this instance is empty.

Declaration
public bool IsEmpty { get; }
Property Value
System.Boolean

true if this instance is empty; otherwise, false.

IsReadOnly

Gets a value indicating whether this instance is read only.

Declaration
public bool IsReadOnly { get; }
Property Value
System.Boolean

true if this instance is read only; otherwise, false.

Implements
System.Collections.Generic.ICollection<T>.IsReadOnly

Maximum

Gets the maximum.

Declaration
public virtual T Maximum { get; }
Property Value
T

Implements
ISearchTree<T>.Maximum

Minimum

Gets the minimum.

Declaration
public virtual T Minimum { get; }
Property Value
T

Implements
ISearchTree<T>.Minimum

Tree

Gets or sets the binary tree.

Declaration
protected BinaryTree<T> Tree { get; set; }
Property Value
BinaryTree<T>

Methods

Add(T)

Adds the specified item.

Declaration
public void Add(T item)
Parameters
T item

The item.

Implements
System.Collections.Generic.ICollection<T>.Add(T)

AddItem(T)

Adds the item.

Declaration
protected abstract void AddItem(T item)
Parameters
T item

The item.

Clear()

Clears this instance.

Declaration
public void Clear()
Implements
System.Collections.Generic.ICollection<T>.Clear()

ClearItems()

Clears all the objects in this instance.

Declaration
protected virtual void ClearItems()
Remarks

Notes to Inheritors: Derived classes can override this method to change the behavior of the Clear() method.

Contains(T)

Determines whether the item is in this tree.

Declaration
public virtual bool Contains(T item)
Parameters
T item

The item.

Returns
System.Boolean

true if [contains] [the specified item]; otherwise, false.

Implements
System.Collections.Generic.ICollection<T>.Contains(T)

CopyTo(T[], Int32)

Copies to.

Declaration
public void CopyTo(T[] array, int arrayIndex)
Parameters
T[] array

The array.

System.Int32 arrayIndex

Index of the array.

Implements
System.Collections.Generic.ICollection<T>.CopyTo(T[], System.Int32)

DepthFirstTraversal(IVisitor<T>)

Depth first search traversal.

Declaration
public void DepthFirstTraversal(IVisitor<T> visitor)
Parameters
IVisitor<T> visitor

The visitor.

Implements
ISearchTree<T>.DepthFirstTraversal(IVisitor<T>)

FindMaximumNode()

Find the maximum node.

Declaration
protected BinaryTree<T> FindMaximumNode()
Returns
BinaryTree<T>

The maximum node.

FindMaximumNode(BinaryTree<T>)

Finds the maximum node.

Declaration
protected static BinaryTree<T> FindMaximumNode(BinaryTree<T> startNode)
Parameters
BinaryTree<T> startNode

The start node.

Returns
BinaryTree<T>

The maximum node below this node.

FindMinimumNode()

Find the minimum node.

Declaration
protected BinaryTree<T> FindMinimumNode()
Returns
BinaryTree<T>

The minimum node.

FindMinimumNode(BinaryTree<T>)

Finds the minimum node.

Declaration
protected static BinaryTree<T> FindMinimumNode(BinaryTree<T> startNode)
Parameters
BinaryTree<T> startNode

The start node.

Returns
BinaryTree<T>

The minimum node below this node.

FindNode(T)

Finds the node containing the specified data key.

Declaration
protected virtual BinaryTree<T> FindNode(T item)
Parameters
T item

The item.

Returns
BinaryTree<T>

The node with the specified key if found. If the key is not in the tree, this method returns null.

FindNode<TSearch>(TSearch, BinarySearchTreeBase<T>.CustomComparison<TSearch>)

Finds the node that matches the custom delegate.

Declaration
protected virtual BinaryTree<T> FindNode<TSearch>(TSearch value, BinarySearchTreeBase<T>.CustomComparison<TSearch> customComparison)
Parameters
TSearch value

The value.

BinarySearchTreeBase.CustomComparison<TSearch> customComparison

The custom comparison.

Returns
BinaryTree<T>

The item if found, else null.

Type Parameters
TSearch

The type of the search.

GetEnumerator()

Returns an enumerator that iterates through the collection.

Declaration
public IEnumerator<T> GetEnumerator()
Returns
System.Collections.Generic.IEnumerator<T>

A System.Collections.Generic.IEnumerator<T> that can be used to iterate through the collection.

Implements
System.Collections.Generic.IEnumerable<T>.GetEnumerator()

GetOrderedEnumerator()

Gets the ordered enumerator.

Declaration
public IEnumerator<T> GetOrderedEnumerator()
Returns
System.Collections.Generic.IEnumerator<T>

Implements
ISearchTree<T>.GetOrderedEnumerator()

Remove(T)

Removes the specified item.

Declaration
public bool Remove(T item)
Parameters
T item

The item.

Returns
System.Boolean

Implements
System.Collections.Generic.ICollection<T>.Remove(T)

RemoveItem(T)

Removes the item from the tree.

Declaration
protected abstract bool RemoveItem(T item)
Parameters
T item

The item to remove.

Returns
System.Boolean

An indication of whether the item has been removed from the tree.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
System.Collections.IEnumerator

Implements
System.Collections.IEnumerable.GetEnumerator()

Extension Methods

CommonExtensions.AddRange<T>(ICollection<T>, IEnumerable<T>)
CommonExtensions.ContainsAny<T>(IEnumerable<T>, IEnumerable<T>)
CommonExtensions.ForEach<T>(IEnumerable<T>, Action<T>)
CommonExtensions.Clone<T>(IEnumerable<T>)
SvgExtentions.Traverse<T>(IEnumerable<T>, Func<T, IEnumerable<T>>)
SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(IEnumerable<T>, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)

See Also

RedBlackTree<TKey, TValue>
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.