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::