Khan.randRange(6, 10) Khan.randRange(numV, (numV * (numV - 1))/2) Khan.randRange(4,6) Khan.randRange(2,4) (numV * pointerB) + (2 * numE * (vertB + pointerB))

WARNING! Read the conditions for the problems in this set very carefully!

Assume for an undirected graph with numV vertices and numE edges that a vertex index requires vertB bytes, and a pointer requires pointerB bytes. The graph is unweighted, so the adjacency list does not store any weight information. Since the graph is undirected, each undirected edge is represented by two directed edges. Calculate the byte requirements for an adjacency list.

ANS

Adjacency list has an array (of size |V|) which points to a list of edges.

Every edge appears twice on the list (the graph is undirected, so we need the directed edge in each direction). And for each edge there has to be a vertex ID and a pointer to the next edge.

(V * pointer) + (2 * E * (vertex_index + pointer)) bytes = ANS