This is a C++
implementation of a Prufer code algorithm. Supports both coding and decoding.
Input style: Number of vertices
and edges of the graph
Input | Output |
---|---|
9 2 8 8 5 1 5 1 9 5 4 5 3 3 7 3 6 |
Prufer code: 8 5 3 3 5 5 1 Edges: 8 2 5 4 3 6 3 7 5 3 5 8 1 5 1 9 |
Input | Output |
---|---|
6 1 4 1 2 4 5 5 6 5 3 |
Prufer code: 1 4 5 5 Edges: 1 2 4 1 5 3 5 4 5 6 |