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

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.

Edited 4 Years Ago by Ancient Dragon

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

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

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.

Edited 4 Years Ago by deceptikon

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)

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