i'm trying to understand a piece of algorithm taken from a c++ code , here's the C++ code
inline void DBGame::make_chain( Edge* &newedge, Edge *edges[], Node *node ){
newedge->length = edges[0]->length + edges[1]->length;
for (int j = 0; j < 2; j++)
{
edges[j]->parent = newedge;
edges[j]->remove();
// replace the old edge with the new edge at the other end
// -------------------------------------------------------
int k = (edges[j]->node[0] == node);
newedge->node[j] = edges[j]->node[k];
newedge->pself[j] = edges[j]->pself[k];
*newedge->pself[j] = newedge;
}
}
fyi, node is an object and not an integer.
I don't understand how to assign an integer value to int k by giving an true-false expression.