I'm doing a work on graphs and I need to read in the file the data entry of a file, for example:
VERTICES 0 1 2 3 4
ARESTAS 0 1 2 3
After reading the file I need to instantiate these vertices and edges, I would like to know a way in which I can instantiate dynamically, that is, create a number of instances according to the number of vertices and edges that were read from the file and then add them to a list.
I'm new to programming and would like to know if it's possible to do this and how I do it, or if there is a better method for that purpose.