#include<stdio.h>
#include<conio.h>

main()
{
    int a[5],priority[5],adj[5][5]={0},i,j,k;

    a[0]=3;
    a[1]=4;
    a[2]=5;
    a[3]=7;
    a[4]=10;

    adj[0][1]=1;
    adj[0][2]=1;
    adj[0][3]=1;
    adj[1][0]=1;
    adj[2][0]=1;
    adj[2][4]=1;
    adj[3][0]=1;
    adj[4][2]=1;

    /*
    the ads[4][4] represents the linking edges
    adj[4][4]= 0  1  1  1  0
               1  0  0  0  1
               1  0  0  0  0
               1  0  0  0  0
               0  0  1  0  0
    */


    /* I want a priority list based on largest number first
    while following the linking edges
    So that :
    priority[0]=4
    priority[1]=2
    priority[2]=0
    priority[3]=3
    priority[4]=1

But HOW?
    */

}

Please help me..

Recommended Answers

All 5 Replies

But HOW?

I have no idea -- ask your teacher how to drive the priority list from the matrix.

main()

Learn to program correctly -- it's int main(), not just main(). There is int before the function name.

Please shut up if you don't know how to code...

commented: idiot - accusing Ancient Dragon of not knowing how to code is about as stoooopid as you can get +0
commented: Why are you so rude +0

Please shut up if you don't know how to code...

Thank you so much for that comment. I might have actually wasted time helping an ungrateful jerk. I really appreciate your concern for everyone's time. Best of luck with your problem.

This forum sucks.................

commented: Garbage in, garbage out. -2
commented: Ungrateful, Again ! -1

Good luck from me also, at least you allready got the assignement statement, maybe you could move on to loops for a challenge, maybe those i,j,k variables is hint from your teacher for that? And you could only include modules which are standard and used in your code (and no conio is not one of them)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.