コード例 #1
0
ファイル: Program.cs プロジェクト: NaskoVasilev/Algorithms
        public int CompareTo(Edge other)
        {
            int compare = Weigth.CompareTo(other.Weigth);

            if (compare == 0)
            {
                compare = StartNode.CompareTo(other.StartNode);
                if (compare == 0)
                {
                    compare = EndNode.CompareTo(other.EndNode);
                }
            }

            return(compare);
        }
コード例 #2
0
        public int CompareTo(Edge other)
        {
            int compare = Cost.CompareTo(other.Cost);

            if (compare == 0)
            {
                compare = StartNode.CompareTo(other.StartNode);
                if (compare == 0)
                {
                    compare = EndNode.CompareTo(other.EndNode);
                }
            }

            return(compare);
        }