public void TestClusterizer()
        {
            var clusterizer = new Clusterizer();

            clusterizer.Add("000000000000000000000000");
            clusterizer.Add("111000000000000000000000");
            clusterizer.Add("000000000000000000000111");
            clusterizer.Add("000000000000000000000101");
            Assert.AreEqual(2, clusterizer.DisjointSetsCount);
        }
示例#2
0
        static void Main(string[] args)
        {
            var    i           = 0;
            var    clusterizer = new Clusterizer();
            string line;
            var    reader = new StreamReader("clustering_big.txt");

            while ((line = reader.ReadLine()) != null)
            {
                i += 1;
                if (i % 1000 == 0)
                {
                    Console.WriteLine(i);
                }
                clusterizer.Add(line.Replace(" ", ""));
            }
            Console.WriteLine(clusterizer.DisjointSetsCount);
            Console.ReadKey();
        }