I am trying to get an algorithm to convert an adjacency list to adjacency matrix to write a function in my own way in C. Hope someone will help me. Thanks in advance.
This is a discussion on What will be the algorithm to convert an adjacency list to adjacency matrix? within the C Programming forums, part of the General Programming Boards category; I am trying to get an algorithm to convert an adjacency list to adjacency matrix to write a function in ...
I am trying to get an algorithm to convert an adjacency list to adjacency matrix to write a function in my own way in C. Hope someone will help me. Thanks in advance.
- Start with all zeroes
- For every pair of adjacent nodes
- Put a one in that spot in the matrix
- That's it.