3 ms·
In what sense graphs require mutation?
by zokier 3y ago
In what sense graphs require mutation?
- joshlemer 3y agoI think maybe they're talking about how, in order to create a data structure where two nodes contain a reference (edge) to each other, you have to resort to mutation. i.e. you have to create A, then B with reference to A, then mutate A to refer to B, or you have to create B, then A with reference to B, then mutate B to refer to A. Though this ignores that there are other ways to represent graphs, such as adjacency matrices, etc.