CLRS icon indicating copy to clipboard operation
CLRS copied to clipboard

Solution to 22.1 - 4 is Wrong

Open nshmadhani opened this issue 4 years ago • 1 comments

Current solution does overrides the previous value of edges from u to v.

if there is and edge between 1 -> 3, 2 -> 3, 3 -> 1 -> 2. Then A[3] will be first 1 and then A[3] = 2.

This would override the previous value and 3->1 will be included in the graph.

nshmadhani avatar Dec 05 '21 20:12 nshmadhani

A should be a matrix of |V| * |V| and edges should be marked as A[v][u] = 1, to know if any edge has been repeated

nshmadhani avatar Dec 05 '21 20:12 nshmadhani