Skip to content

Instantly share code, notes, and snippets.

@GER-NaN
Created December 30, 2016 19:58
Show Gist options
  • Select an option

  • Save GER-NaN/1bb790d484f8380f1a9e307315bcfc9a to your computer and use it in GitHub Desktop.

Select an option

Save GER-NaN/1bb790d484f8380f1a9e307315bcfc9a to your computer and use it in GitHub Desktop.
A GraphNode class
/*
https://msdn.microsoft.com/en-us/library/ms379574(v=vs.80).aspx
An Extensive Examination of Data Structures Using C# 2.0
Visual Studio 2005
Scott Mitchell
4GuysFromRolla.com
Update January 2005
*/
public class GraphNode<T> : Node<T>
{
private List<int> costs;
public GraphNode() : base() { }
public GraphNode(T value) : base(value) { }
public GraphNode(T value, NodeList<T> neighbors) : base(value, neighbors) { }
new public NodeList<T> Neighbors
{
get
{
if (base.Neighbors == null)
base.Neighbors = new NodeList<T>();
return base.Neighbors;
}
}
public List<int> Costs
{
get
{
if (costs == null)
costs = new List<int>();
return costs;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment