I need to implement Dijikstra's and Floyds algorithm using a linked list !!! can anyone give a code on how to do it !! because i know to implement it using Matrix but am not familiar with the linked list !!
please help me on this !!!

The rules of the implementation are:
1. weights are generated randomly not as input
2. All nodes are connected to each other
3. The code had to be implemented in C

below is the code I have been able to implement so far, but i need to implement Dijiktra nad Floyd in this.

#include <stdio.h>
#include <stdlib.h>

struct node{
    int value;
    struct node *nextNode;

int main(int argc, char** argv) {

    int random[15*15-15];
    struct node *pointerArray[5];
    struct node *oneNode;
    int i=0;
    int j=0;
        oneNode = (struct node *) malloc(sizeof (struct node));     // the first node of each row
        oneNode->value = i;
        *(pointerArray+i) = oneNode;
                struct node *anotherNode = (struct node *) malloc(sizeof (struct node));     // the first node of each row
                anotherNode->value = j;
                oneNode->nextNode = anotherNode;
                oneNode = anotherNode;
    struct node *p;
        p = *(pointerArray+i);
            p = p->nextNode;
                 printf(" -> ");
        } //  end while
    return (EXIT_SUCCESS);

Edited 6 Years Ago by WaltP: Added CODE tags -- with all the help about them, how could you miss using them????

This article has been dead for over six months. Start a new discussion instead.