How to store a graph in PASCAL

Revision en3, by IloveGoodness, 2021-07-21 21:30:11

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

Tags free pascal, pascal

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English IloveGoodness 2021-07-21 21:30:11 58 Tiny change: 'in Pascal?' -> 'in Pascal?\n\nUPD: thanks [user:Rifat83] for the solution'
en2 English IloveGoodness 2021-07-21 16:51:00 5 Tiny change: 'be stored only using vec' -> 'be stored using vec'
en1 English IloveGoodness 2021-07-21 16:50:31 382 Initial revision (published)