Craig's Utility Library  4.0 Beta
Utilities.DataTypes.BinaryTree< T > Class Template Reference

Binary tree More...

Inheritance diagram for Utilities.DataTypes.BinaryTree< T >:

Public Member Functions

 BinaryTree (TreeNode< T > root=null)
 Constructor More...
 
virtual void Add (T item)
 Adds an item to a binary tree More...
 
virtual void Clear ()
 Clears all items from the tree More...
 
virtual bool Contains (T item)
 Determines if the tree contains an item More...
 
virtual void CopyTo (T[] array, int arrayIndex)
 Copies the tree to an array More...
 
virtual IEnumerator< T > GetEnumerator ()
 Gets the enumerator More...
 
virtual bool Remove (T item)
 Removes an item from the tree More...
 
override string ToString ()
 Outputs the tree as a string More...
 

Static Public Member Functions

static implicit operator string (BinaryTree< T > Value)
 Converts the object to a string More...
 

Protected Member Functions

virtual TreeNode< T > Find (T item)
 Finds a specific object More...
 
virtual void Insert (T item)
 Inserts a value More...
 
virtual IEnumerable< TreeNode< T > > Traversal (TreeNode< T > Node)
 Traverses the list More...
 

Properties

virtual int Count [get]
 Number of items in the tree More...
 
virtual bool IsEmpty [get]
 Is the tree empty More...
 
virtual bool IsReadOnly [get]
 Is this read only? More...
 
virtual T MaxValue [get]
 Gets the maximum value of the tree More...
 
virtual T MinValue [get]
 Gets the minimum value of the tree More...
 
virtual TreeNode< T > Root [get, set]
 The root value More...
 
virtual int NumberOfNodes [get, set]
 The number of nodes in the tree More...
 

Detailed Description

Binary tree

Template Parameters
TThe type held by the nodes
Type Constraints
T :IComparable<T> 

Definition at line 33 of file BTree.cs.

Constructor & Destructor Documentation

Constructor

Parameters
rootRoot of the binary tree

Definition at line 40 of file BTree.cs.

Member Function Documentation

virtual void Utilities.DataTypes.BinaryTree< T >.Add ( item)
virtual

Adds an item to a binary tree

Parameters
itemItem to add

Definition at line 129 of file BTree.cs.

virtual void Utilities.DataTypes.BinaryTree< T >.Clear ( )
virtual

Clears all items from the tree

Definition at line 145 of file BTree.cs.

virtual bool Utilities.DataTypes.BinaryTree< T >.Contains ( item)
virtual

Determines if the tree contains an item

Parameters
itemItem to check
Returns
True if it is, false otherwise

Definition at line 156 of file BTree.cs.

virtual void Utilities.DataTypes.BinaryTree< T >.CopyTo ( T[]  array,
int  arrayIndex 
)
virtual

Copies the tree to an array

Parameters
arrayArray to copy to
arrayIndexIndex to start at

Definition at line 178 of file BTree.cs.

virtual TreeNode<T> Utilities.DataTypes.BinaryTree< T >.Find ( item)
protectedvirtual

Finds a specific object

Parameters
itemThe item to find
Returns
The node if it is found

Definition at line 261 of file BTree.cs.

virtual IEnumerator<T> Utilities.DataTypes.BinaryTree< T >.GetEnumerator ( )
virtual

Gets the enumerator

Returns
The enumerator

Definition at line 194 of file BTree.cs.

virtual void Utilities.DataTypes.BinaryTree< T >.Insert ( item)
protectedvirtual

Inserts a value

Parameters
itemitem to insert

Definition at line 273 of file BTree.cs.

static implicit Utilities.DataTypes.BinaryTree< T >.operator string ( BinaryTree< T >  Value)
static

Converts the object to a string

Parameters
ValueValue to convert
Returns
The value as a string

Definition at line 119 of file BTree.cs.

virtual bool Utilities.DataTypes.BinaryTree< T >.Remove ( item)
virtual

Removes an item from the tree

Parameters
itemItem to remove
Returns
True if it is removed, false otherwise

Definition at line 207 of file BTree.cs.

override string Utilities.DataTypes.BinaryTree< T >.ToString ( )

Outputs the tree as a string

Returns
The string representation of the tree

Definition at line 251 of file BTree.cs.

virtual IEnumerable<TreeNode<T> > Utilities.DataTypes.BinaryTree< T >.Traversal ( TreeNode< T >  Node)
protectedvirtual

Traverses the list

Parameters
NodeThe node to start the search from
Returns
The individual items from the tree

Definition at line 319 of file BTree.cs.

Property Documentation

virtual int Utilities.DataTypes.BinaryTree< T >.Count
get

Number of items in the tree

Definition at line 55 of file BTree.cs.

virtual bool Utilities.DataTypes.BinaryTree< T >.IsEmpty
get

Is the tree empty

Definition at line 62 of file BTree.cs.

virtual bool Utilities.DataTypes.BinaryTree< T >.IsReadOnly
get

Is this read only?

Definition at line 68 of file BTree.cs.

virtual T Utilities.DataTypes.BinaryTree< T >.MaxValue
get

Gets the maximum value of the tree

Definition at line 76 of file BTree.cs.

virtual T Utilities.DataTypes.BinaryTree< T >.MinValue
get

Gets the minimum value of the tree

Definition at line 92 of file BTree.cs.

virtual int Utilities.DataTypes.BinaryTree< T >.NumberOfNodes
getsetprotected

The number of nodes in the tree

Definition at line 112 of file BTree.cs.

virtual TreeNode<T> Utilities.DataTypes.BinaryTree< T >.Root
getset

The root value

Definition at line 107 of file BTree.cs.


The documentation for this class was generated from the following file: