public void IsConnected_FalseForNotConnected()
        {
            var algorithm = new QuickUnionWeighted(10);

            algorithm.Union(1, 8);
            algorithm.Union(3, 5);
            algorithm.Union(0, 2);
            algorithm.Union(8, 9);
            algorithm.Union(6, 1);

            Assert.False(algorithm.IsConnected(0, 3));
        }
        public void IsConnected_TrueForConnected()
        {
            var algorithm = new QuickUnionWeighted(10);

            algorithm.Union(1, 8);
            algorithm.Union(3, 5);
            algorithm.Union(0, 2);
            algorithm.Union(8, 9);
            algorithm.Union(6, 1);

            Assert.True(algorithm.IsConnected(8, 1));
        }