Пример #1
0
        static void Main(string[] args)
        {
            QuickUnionUF demo = new QuickUnionUF(10);

            demo.Union(4, 3);
            demo.Union(3, 8);
            demo.Union(6, 5);
            Console.WriteLine(demo.Connected(4, 8));
            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            QuickUnionUF qu = new QuickUnionUF(10);

            qu.union(3, 4);
            qu.union(4, 9);
            qu.union(2, 9);

            qu.union(5, 6);

            qu.Print();
        }