0
I am doing a work on graphs and need to read in the file the input of data from a file, example :
VERTICES 0 1 2 3 4
EDGES 0 1 2 3
After reading the file need to instantiate these vertices and edges, would like to know a way by which I can instantiate dynamically, ie create a number of instances according to the number of vertices and edges that were read from the file and then addthem on a list.
I am new to programming and would like to know if it is possible to do this and how I do it, or if there is a better method for this goal.
Good afternoon, do not use stacksnippet for codes that cannot be executed, read to understand how it works: http://meta.pt.stackoverflow.com/a/4463/3635 . I’m sure you’ll take my comment as a constructive criticism :)
– Guilherme Nascimento