public int CompareTo(NodeInfo other) { if (other == null) { return(1); } if (other == this) { return(0); } if (TotalCost.Equals(other.TotalCost)) { return(0); } return(TotalCost > other.TotalCost ? 1 : -1); }