Skip to content

Instantly share code, notes, and snippets.

@GER-NaN
Last active December 30, 2016 19:57
Show Gist options
  • Save GER-NaN/5b40ce689dfb9948d98f6925a54e4f53 to your computer and use it in GitHub Desktop.
Save GER-NaN/5b40ce689dfb9948d98f6925a54e4f53 to your computer and use it in GitHub Desktop.
Node class
/*
https://msdn.microsoft.com/en-us/library/ms379572(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 Node<T>
{
// Private member-variables
private T data;
private NodeList<T> neighbors = null;
public Node() {}
public Node(T data) : this(data, null) {}
public Node(T data, NodeList<T> neighbors)
{
this.data = data;
this.neighbors = neighbors;
}
public T Value
{
get
{
return data;
}
set
{
data = value;
}
}
protected NodeList<T> Neighbors
{
get
{
return neighbors;
}
set
{
neighbors = value;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment