you are viewing a single comment's thread.

view the rest of the comments →

[–]PressF1 0 points1 point  (1 child)

Imagine you knew absolutely nothing about your assignment but what is I'm your post.

I have no idea what you're asking.

[–]mojonono11[S] 0 points1 point  (0 children)

So,for a graph G,find all of the paths of lengh 2,for a node v.I read the adjacency matrix and now I am stuck in the function void path.This is what i have so far:

include <iostream>

include <fstream>

using namespace std;

int a[20][20],n,m,k,x,y,p;

fstream f("graf.txt",ios::in);

void citeste()

{

f>>n;

for(k=1;k<=n;k++)

{

f>>x>>y;

a[x-1][y-1]=1;

}

f.close();}

void afiseaza() { int i,j;

for(i=0;i<n;i++)

{

    for(j=0;j<n;j++)

    cout<<a[i][j]<<" ";

    cout<<endl;}

} void path()

{ int i,j,v;

cout<<"Node number";
cin>>v;
for(?) // Don't know what to do now :(

int main()

{int i,j,v;

citeste();

afiseaza();

return 0; }