View Single Post
Old 10-26-2004, 06:14 AM   #3 (permalink)
coolsc81
Registered User
 
Join Date: Oct 2004
Posts: 2
coolsc81 is on a distinguished road
Here is what I got so far... I need help with finishing the code and implementing it to a program.

Thanks for the help.

- Shawn


Sample code:
Code:
struct Node
{

char Name:
Node *next;

};

Node Graph[20];


// 1. Construct Resource Graph
// 2. Detect deadlock
// 3. Quit

// Source: A
// Destination: B
// More? If true:
// Source: B
// Destination: D
// ...
// ...
// More? If false:
// Execute Detection Algorithum

// ..

// print L = A , B , C , D , C

// index:

void Main()

{

indx = 0;
Menu;
switch(choice)
{
n 
case 1:

break;

case 2:

break;

}
}



// Case 1:

while (Ans != 'T')
{
node * S_Pointer, D_Pointer;
cout << "Source:";
cin >> source;
cout << "Destination:";
cin >> destination;


for(i=0; i<20; i++)
{


if ( Graph[i].Name == source)
{

SePointer = Graph[i].Name;
found = true;
}

if(!found)
{
S_Pointer = Graph[index];
index++;

}
}
}


// same for destination
::edited by sde, please use [ code] tags::

Last edited by sde; 10-26-2004 at 06:52 AM.
coolsc81 is offline   Reply With Quote