s1=1;s2=1; for(i=1;i<=n;i++) if(HT[i].parent==0) { min=HT[i].weight; s1=i; break; } tempi=i++; for(;i<=n;i++) if(HT[i].weight<min&&HT[i].parent==0) { min=HT[i].weight; s1=i; } for(i=tempi;i<=n;i++) if(HT[i].parent==0&&i!=s1) { secmin=HT[i].weight; s2=i; break; } for(i=1;i<=n;i++) if(HT[i].weight<secmin&&i!=s1&&HT[i].parent==0) { secmin=HT[i].weight; s2=i; } if(s1>s2)