they are saying its B...even I got C.

Dark Mode

196 views

1 vote

Best answer

answer C) option

suppose we have vertex of graph with 4 vertices so we need 4 *4 ,matrix which will show that either edges is present in the graph or not if edge is present than mark it as 1 if no edge is present than put zero in that particular slot we need **O(V ^{2})**

still we need correction in option :)

1 vote

Answer will be C : 0(N ^ 2 ).

because we are representing the graph in matrix which have number of rows equals to number of columns = N ( Total nodes )

And also, adjacency matrix were independent of edges, it will always take O(N^2) space to represent graph as adjacency matrix,

either graph have no edges , few edges or any number of edges.

because we are representing the graph in matrix which have number of rows equals to number of columns = N ( Total nodes )

And also, adjacency matrix were independent of edges, it will always take O(N^2) space to represent graph as adjacency matrix,

either graph have no edges , few edges or any number of edges.