Complete the code to create a graph with 3 vertices labeled 'A', 'B', and 'C'.
const vertices = ['A', 'B', [1]];
The third vertex label is 'C' to match the problem statement.
Complete the code to add an edge from vertex 'A' to vertex 'B' in a directed graph.
const edge = { from: 'A', to: [1] };The edge goes from 'A' to 'B', so 'to' must be 'B'.
Fix the error in the code to correctly represent an undirected edge between 'A' and 'B'.
const edge = { vertices: ['A', [1]] };Undirected edge connects 'A' and 'B', so the second vertex is 'B'.
Fill both blanks to create a weighted directed edge from 'A' to 'B' with weight 5.
const edge = { from: 'A', to: [1], weight: [2] };The edge goes from 'A' to 'B' with weight 5.
Fill all three blanks to create a weighted undirected edge between 'A' and 'C' with weight 7.
const edge = { vertices: [[1], [2]], weight: [3] };The undirected edge connects 'A' and 'C' with weight 7.
