In C++, Graphs with large number of nodes (N > 3000) can be stored using vectors
vector<int> adjanced_nodes[N];
if (an edge exists between u and w)
{
adjacent_nodes[u].push_back(w);
adjacent_nodes[w].push_back(u);
}
Pascal language doesn't have vectors, Can anyone please tell how we can store graphs in Pascal?
UPD: thanks Rifat83 for the solution
In Pascal it is possible define fixed array like:
or if array size is not known at the time of compilation then it is possible to use dynamic arrays, e.g. in FreePascal like: