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

  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,336
    • 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, 01: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, 10:21 PM

Tags for this Thread