MENU
Question -

Write a function QINSERT() in C+ + to perform insert operation on a Linked Queue, which contains Client no and Client name. Consider the following definition of NODE in the code of . QINSERT ().    
struct Node
{
long int Cno; // Client No 
char Cname [20]; //
Client Name 
Node *Next ;
};



Answer -

Function to Insert element
Node * QINSERT (Node *rear, int val),

char val []
{
Node *temp; 
temp = new Node;
temp®Cno = val; 
strcpy (temp®Cname, val); 
temp®NEXT=NULL; 
rear®NEXT=temp; 
rear=temp; 
return (rear);

Comment(S)

Show all Coment

Leave a Comment

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