Graph Insertion
Given
G: a list of graphnodes
v: a graphnode
edge: a pair of graphnodes, x and y
And assume listinsert inserts only if not there.
InsertEdge(edge, graph)
listinsert(edge.x, graph)
listinsert(edge.y, graph)
listinsert(edge.y.name, edge.x.edgelist)
return graph
Complexity???
Previous slide
Next slide
Back to first slide
View graphic version