Created
December 30, 2016 19:58
-
-
Save GER-NaN/1bb790d484f8380f1a9e307315bcfc9a to your computer and use it in GitHub Desktop.
A GraphNode class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 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