Skip to content
Snippets Groups Projects
Commit a7e8655f authored by Simon Sundberg's avatar Simon Sundberg
Browse files

Merge branch 'lab3-gettersetter-fix' into 'master'

Fix set_edges() and add get_next_edge()

See merge request !13
parents f1ec221a b052dba8
Branches master
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ pedge get_edges(pnode G)
}
pnode set_edges(pnode G, pedge E)
{
if (is_empty(G))
if (!is_empty(G))
G->edges = E;
return G;
}
......@@ -139,6 +139,10 @@ pedge set_weight(pedge E, double weight)
E->weight = weight;
return E;
}
pedge get_next_edge(pedge E)
{
return edge_empty(E) ? NULL : E->next_edge;
}
// edge_cons: connects two edges in edge list
pedge edge_cons(pedge first, pedge second)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment