In the following code to add an edge in the LinkedDirectedGraph class, what is the missing code?
def addEdge(self, fromLabel, toLabel, weight): fromVertex = self.getVertex(fromLabel) fromVertex.addEdgeTo(toVertex, weight) self.edgeCount += 1
A. self.getVertex(toLabel) = fromVertex
B. fromVertex.addEdgeTo(fromVertex, weight)
C. self.weight += 1
D. toVertex = self.getVertex(toLabel)
Answer: D
Computer Science & Information Technology
You might also like to view...
The Freeze Panes feature allows you to limit the display to those rows that match the criterion you select
Indicate whether the statement is true or false
Computer Science & Information Technology
With _________ the microchip is organized so that a section of memory cells are erased in a single action.
A. flash memory B. SDRAM C. DRAM D. EEPROM
Computer Science & Information Technology