Can anyone pls tell me whats wrong with my code ? im stuck for the last 3 hours ,this question is bipartite graph in c++

idk why im getting error ,can someone help ? im trying to prove if a graph is bipartite or not in c++


bool isBipartite(vector<int> graph[],int V)
{
    vector<int> vis(V,0);
    vector<int> color(V,-1);
    
    color[0]=1;
    queue <int> q;
    q.push(0);
    while (!q.empty())
    {
        int temp = q.front();
        q.pop();
        for (int i=0;i<V;i++)
        {
            if (!vis[i] && color[i] == -1)   "if there is an edge, and colour is not assigned"
            {
                color[i] = 1 - color[temp];
                q.push(i);
                vis[i]=1;
            }
            else if (!vis[i] && color[i] == color[temp] "if there is an edge and both vertices have same colours"
            {
                vis[i]=1;
                return 0;                                // graph is not bipartite
            }
                
            
        }
    }
    return 1;
}

it gives output "no" for whatever i enter

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum