55.8k views
2 votes
In the ADT graph the method clear has efficiency

A. O(1)

B.O(n)

C.O(logn)

D.O(n2)

1 Answer

0 votes

Answer:

The efficiency of ADT graph method clear is option A.O(1)

Step-by-step explanation:

The clear method in ADT graph is used to delete the graph from the memory or simply delete the graph.Since we just have to remove the all the vertices or we can say that we have to delete the container which contains the list of vertices which takes O(1) time we don't have to traverse over anything we can simply delete it in O(1) time.

User Azalut
by
5.4k points