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 QuickSort algorithm was developed in 1960 by

a. Bjarne Stroustrup b. Tony Gaddis c. C.A.R. Hoare d. C.M. Turner e. None of these

Computer Science & Information Technology

In the accompanying figure, item 4 points to the ____.

A. white point B. black point C. histogram D. grayscale point

Computer Science & Information Technology

Several people who connect to the Internet and communicate in real time by typing comments to each other is called a(n) ____.

A. chat group B. instant message C. VoIP D. social network

Computer Science & Information Technology

Adding ________ to code in VBA is an excellent way of communicating the intentions of a procedure to other database administrators, and it is a good way of keeping track of your own code

A) procedures B) Modules C) Declarations D) comments

Computer Science & Information Technology