コード例 #1
0
        public UnionFind(int vertices, IUnionFindAlgorithm algorithm)
        {
            if (algorithm == null)
            {
                throw new ArgumentNullException();
            }

            _algorithm = algorithm;

            _count = vertices;
            _index = new int[vertices];

            for (var i = 0; i < vertices; i++)
            {
                _index[i] = i;
            }
        }
コード例 #2
0
 public QuickFindStrategy(SquareModel[,] matrix)
 {
     _matrix   = matrix;
     Algorithm = new QuickFind(matrix);
 }
コード例 #3
0
ファイル: UfStrategy.cs プロジェクト: rock-walker/UnionFind
 public QuickFindStrategy(SquareModel[,] matrix)
 {
     _matrix = matrix;
     Algorithm = new QuickFind(matrix);
 }