What wrong in my code.giving segmentation fault

#include
#include<bits/stdc++.h>
using namespace std;

void addEdge(vector<pair<int,int>>adj[],int u,int v,int data){
adj[u].push_back(make_pair(v,data));
adj[v].push_back(make_pair(u,data));
}
void printGraph(vector<pair<int,int>>adj[],int v){
for(int i=0;i<v;i++){
for(auto x:adj[i]){
cout<<x.first<<x.second<<" “;
}
cout<<”\n";
}
}
void diskstra(vector<pair<int,int>>adj[],int v,int s){
unordered_map<int,int>dist;
for(int i=0;i<v;i++){
dist[i]=INT_MAX;
}
dist[s]=0;
set<pair<int,int>>d;
d.insert(make_pair(0,s));
while(!d.empty()){
auto e=*(d.begin());
int p=e.first;
int q=e.second;
d.erase(d.begin());
for(auto w:adj[q]){
if(dist[w.first]>p+w.second){
auto f=d.find(make_pair(dist[w.first],w.first));

            if(f!=d.end()){
                d.erase(f);
            }
            dist[w.first]=p+w.second;
            d.insert(make_pair(dist[w.first],w.first));
        }
    }
    
}

for(int i=0;i<v;i++) {
cout<<dist[i]<<" ";
}
}
int main(){
int n;
cin>>n;
for(int k=0;k<n;k++){
int v;
cin>>v;
int e;
cin>>e;
vector<pair<int,int>>adj[v];
for(int i=0;i<e;i++){
int a,b,c;
cin>>a>>b>>c;

addEdge(adj, a, b,c); 
    }
printGraph(adj, v); 

int s;
cin>>s;
diskstra(adj,v,s);
cout<<"\n" ;
}

}

Save your code on ide.codingblocks.com and then share its link.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.