So i am trying to have string as edges in a graph in java using Array in Array list implementation but I have no idea how to do it. i tried doing something in the code I don't know if its correct or not. and it is also giving me an error. If you know any better approach for it as I will be using Dijkstra algorithm on it. So, Please let me know
class inlist{
String source;
String destination;
int time;
inlist(String s,String d,int t){
this.source=s;
this.destination=d;
this.time=t;
}
}
class creategraph{
int n=75;
ArrayList<inlist> [] graph = new ArrayList[n]; // ERROR HERE SAYING { WAS EXPECTED BEFORE ;
graph=new LinkedList<inlist>();
graph["new"]= new ArrayList<inlist>();
}