第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

求大神幫忙看看哪里錯(cuò)了,謝謝!

int CMap::getMinEdge(vector<Edge> edgeVec)

{?

int minWeight=0;?

int edgeIndex=0;

int i=0;

for(;i<edgeVec.size();i++)

{

if(!edgeVec[i].m_bSelected)

{

minWeight=edgeVec[i].m_iWeightValue;

edgeIndex=i;

break;

}

}


if(minWeight==0)

{

return -1;

}

for(;i<edgeVec.size();i++)

{

if(edgeVec[i].m_bSelected)

{

continue;

}

else

{

if(minWeight>edgeVec[i].m_iWeightValue)

{

minWeight=edgeVec[i].m_iWeightValue;

edgeIndex=i;

}

}

}


return edgeIndex;

}


void CMap::primTree(int nodeIndex)

{

int value=0;

int edgeCount=0;

vector <int> nodeVec;

vector <Edge> edgeVec;


cout<<m_pNodeArray[nodeIndex].m_cData<<endl;


nodeVec.push_back(nodeIndex);

m_pNodeArray[nodeIndex].m_bIsVisited=true;

while (edgeCount<m_iCapacity-1)

{

int temp=nodeVec.back();

for(int i=0;i<m_iCapacity;i++)

{

getValueFromMatrix(temp,i,value);

if(value!=0)

{

if(m_pNodeArray[i].m_bIsVisited)

{

continue;

}

else

{

Edge edge(temp,i,value);

edgeVec.push_back(edge);

}

}

}

//從可選邊集合中找出最小的邊

int edgeIndex=getMinEdge(edgeVec);

edgeVec[edgeIndex].m_bSelected=true;


cout<<edgeVec[edgeIndex].m_iNodeIndexA<<"----"<<edgeVec[edgeIndex].m_iNodeIndexB<<" ";

cout<<edgeVec[edgeIndex].m_iWeightValue<<endl;


m_pEdge[edgeCount]=edgeVec[edgeIndex];

edgeCount++;


int nextNodeIndex=edgeVec[edgeIndex].m_iNodeIndexB;


nodeVec.push_back(nextNodeIndex);

m_pNodeArray[nextNodeIndex].m_bIsVisited=true;

cout<<m_pNodeArray[nextNodeIndex].m_cData<<endl;

}

}



正在回答

舉報(bào)

0/150
提交
取消

求大神幫忙看看哪里錯(cuò)了,謝謝!

我要回答 關(guān)注問題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)