This preview shows page 1. Sign up to view the full content.
Unformatted text preview: has degree at most (n − 1) What is the bound for a directed graph?
© 2010 Goodrich, Tamassia number of vertices
number of edges
degree of vertex v Graphs 8 Main Methods of the Graph ADT Vertices and edges Update methods are positions
store elements Accessor methods endVertices(e): an array of the two endvertices of e
opposite(v, e): the vertex opposite of v on e
areAdjacent(v, w): true iff v and w are adjacent
replace(v, x): replace element at vertex v with x
replace(e, x): replace element at edge e with x © 2010 Goodrich, Tamassia Graphs insertVertex(o): insert a vertex storing element o
insertEdge(v, w, o): insert an edge (v,w) storing element o
removeVertex(v): remove vertex v (and its incident edges)
removeEdge(e): remove edge e Iterable collection methods incidentEdges(v): edges inciden...
View Full Document
This document was uploaded on 02/05/2014.
- Winter '14