An adjacency list for a weighted graph

Report a typo

Below is a directed weighted graph:

The directed weighted graph

Build an adjacency list for the graph. Your output is expected to be in the following format:

0: 1,3; 2,5;
1: 2,4; 3,-3;
2:
3: 1,3;

In each list, the first value is a node label, the second is the weight. Node labels must be sorted in ascending order.

Enter a short text
___

Create a free account to access the full topic