待解决问题

for (j=1 ; j<=k-1 ; j++)

    {   if (HT[k].Parent==0)    /* 尚未合并 */

           {   if (HT[j].Weight<w1)

                     {   w2=w1 ; p2=p1 ;

                          w1=HT[j].Weight ; p1=j ; 

                      }

        else if (HT[j].Weight<w2)

                  {  w2=HT[j].Weight ;  p2=j ;   }

     }    /*  找到权值最小的两个值及其下标  */

}

猜你喜欢

转载自blog.csdn.net/m0_38040146/article/details/81435054