MENU
Question -

Give the necessary declaration of linked’ implemented Queue containing players information (as defined in the following definition of Node). Also write a user defined function in C++ to delete one Player’s information from the Queue.

struct node   
{
int Player No ;
char PlayerName[20];
Node*Link;
}



Answer -

NODE *QUEUEDEL(Node * front, int val, char val2[ ])

{
Node *temp;
if (front ==NULL)    [1]
cout<<"Queue EMPTY";
{
else
{
temp=front ;
temp®PlayerNo=val;    [1]
strcpy (temp®PlayerName, val2); 
front=front®Link;    [1]
delete temp;
}
return (front);
}  [1]

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×