vector<int> adjacent[15] ;
vector<int> weight[15];
void addEdge(int i,int j,int weigh)
{
adjacent[a].push_back(i);
adjacent.push_back(j);
weight[a].push_back(weigh);
weight.push_back(weigh);
}
a) O(1)
b) O(V)
c) O(V*V)
d) O(log V)
What would be the time complexity of the following function which adds an edge between two vertices i and j, with some w
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What would be the time complexity of the following function which adds an edge between two vertices i and j, with some w
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!