Question: The class WGraph has two constructors WGraph ( ) and WGraph ( String file ) . The first one creates an empty graph and the
The class WGraph has two constructors WGraph and WGraphString file The first one creates an empty graph and the second uses a file to initialize a graph. Graphs are encoded using the following format: the first line corresponds to two integers, separated by one space, that repre sent the source and the destination nodes.The second line of this file is a single integer n that indicates the number of nodes in the graph. Each vertex is labelled with a number in n and each integer in n represents one and only one vertex. The following lines respect the syntax n n w where n and n are integers representing the nodes connected by an edge, and w the weight of this edge.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
