91. Space complexity for an adjacency list of an undirected graph having large values of V (vertices) and E (edges) is . . . . . . . .
92. What is time complexity to check if a string(length S1) is a substring of another string(length S2) stored in a Directed Acyclic Word Graph, given S2 is greater than S1?
93. Determine the number of vertices for the given Graph or Multigraph?
G is a 4-regular Graph having 12 edges.
G is a 4-regular Graph having 12 edges.
94. Floyd Warshall Algorithm used to solve the shortest path problem has a time complexity of . . . . . . . .
95. Time complexity to check if an edge exists between two vertices would be . . . . . . . .
96. For a given graph G having v vertices and e edges which is connected and has no cycles, which of the following statements is true?
97. In the given connected graph G, what is the value of rad(G) and diam(G)?
98. All paths and cyclic graphs are bipartite graphs.
99. What would be the output of the following C++ program if the given input is
0 0 0 1 1
0 0 0 0 1
0 0 0 1 0
1 0 1 0 0
1 1 0 0 0
#include <bits/stdc++.h>
using namespace std;
bool visited[5];
int G[5][5];
void fun(int i)
{
cout<<i<<" ";
visited[i]=true;
for(int j=0;j<5;j++)
if(!visited[j]&&G[i][j]==1)
fun(j);
}
int main()
{
for(int i=0;i<5;i++)
for(int j=0;j<5;j++)
cin>>G[i][j];
for(int i=0;i<5;i++)
visited[i]=0;
fun(0);
return 0;
}
0 0 0 1 1
0 0 0 0 1
0 0 0 1 0
1 0 1 0 0
1 1 0 0 0
#include <bits/stdc++.h>
using namespace std;
bool visited[5];
int G[5][5];
void fun(int i)
{
cout<<i<<" ";
visited[i]=true;
for(int j=0;j<5;j++)
if(!visited[j]&&G[i][j]==1)
fun(j);
}
int main()
{
for(int i=0;i<5;i++)
for(int j=0;j<5;j++)
cin>>G[i][j];
for(int i=0;i<5;i++)
visited[i]=0;
fun(0);
return 0;
}
100. What is the maximum number of edges in a bipartite graph having 10 vertices?
Read More Section(Graphs)
Each Section contains maximum 100 MCQs question on Graphs. To get more questions visit other sections.