Class GraphNode<TValue>
Inheritance
System.Object
GraphNode<TValue>
Implements
System.IComparable<GraphNode<TValue>>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: AlgorithmsAndDataStructures.Algorithms.GraphTraversal
Assembly: AlgorithmsAndDataStructures.dll
Syntax
public class GraphNode<TValue> : IComparable<GraphNode<TValue>>
Type Parameters
Name | Description |
---|---|
TValue | The type of the value stored in the node. |
Constructors
| Improve this Doc View SourceGraphNode(TValue)
Constructor
Declaration
public GraphNode(TValue value)
Parameters
Type | Name | Description |
---|---|---|
TValue | value | The value to be stored in the node. |
Fields
| Improve this Doc View SourceMaxValue
The maximum value for GraphNode type.
Declaration
public static readonly GraphNode<TValue> MaxValue
Field Value
Type | Description |
---|---|
GraphNode<TValue> |
MinValue
The minimum value for GraphNode type.
Declaration
public static readonly GraphNode<TValue> MinValue
Field Value
Type | Description |
---|---|
GraphNode<TValue> |
Properties
| Improve this Doc View SourceAdjacents
Declaration
public List<GraphEdge<TValue>> Adjacents { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<GraphEdge<TValue>> | The list of all the adjacent nodes of this node. These are the nodes that are connected to this node by a direct edge. |
DistanceFromStartNode
Declaration
public int DistanceFromStartNode { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The distance of this node from a node at which traversal of the graph containing current node starts. Used in BFS, and DFS. |
IsInserted
Declaration
public bool IsInserted { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Determines whether this node, in a particular instance of a traversal algorithm has been already visited : inserted in the queue/stack. |
Value
Declaration
public TValue Value { get; set; }
Property Value
Type | Description |
---|---|
TValue | The value stored in the node. |
Methods
| Improve this Doc View SourceCompareTo(GraphNode<TValue>)
Compares this node to another node of type GraphNode.
Declaration
public int CompareTo(GraphNode<TValue> other)
Parameters
Type | Name | Description |
---|---|---|
GraphNode<TValue> | other | A graph node |
Returns
Type | Description |
---|---|
System.Int32 | 0 if equal, 1 if current node is bigger than |
Implements
System.IComparable<T>