What will be the algorithm to convert an adjacency list to adjacency matrix?

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 ...

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    3

    Lightbulb What will be the algorithm to convert an adjacency list to adjacency matrix?

    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.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    • Start with all zeroes
    • For every pair of adjacent nodes
      • Put a one in that spot in the matrix
    • That's it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C - access violation
    By uber in forum C Programming
    Replies: 2
    Last Post: 07-08-2009, 02:30 PM
  2. Replies: 6
    Last Post: 03-02-2005, 02:45 AM
  3. link list
    By Unregistered in forum C++ Programming
    Replies: 4
    Last Post: 12-13-2001, 05:41 AM
  4. 1st Class LIST ADT
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 11-09-2001, 07:29 PM
  5. singly linked list
    By clarinetster in forum C Programming
    Replies: 2
    Last Post: 08-26-2001, 11:21 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21