static double UnionFindTest(IUnionFind uf, int n)
        {
            Stopwatch sw = new Stopwatch();

            sw.Start();
            Random rand = new Random();

            // 进行n次操作, 每次随机选择两个元素进行合并
            for (int i = 0; i < n; i++)
            {
                int a = rand.Next(n);
                int b = rand.Next(n);
                uf.UnitElement(a, b);
            }

            // 进行n次操作, 每次随机判断两个元素是否相连接
            for (int i = 0; i < n; i++)
            {
                int a = rand.Next(n);
                int b = rand.Next(n);
                uf.IsConnected(a, b);
            }

            sw.Stop();
            return(sw.Elapsed.TotalSeconds);
        }