NCERT Solutions Class 12 Computer Science Chapter 4 Queue

Get the most accurate NCERT Solutions for Class 12 Computer Science Chapter 4 Queue here. Updated for the 2025-26 academic session, these solutions are based on the latest NCERT textbooks for Class 12 Computer Science. Our expert-created answers for Class 12 Computer Science are available for free download in PDF format.

Detailed Chapter 4 Queue NCERT Solutions for Class 12 Computer Science

For Class 12 students, solving NCERT textbook questions is the most effective way to build a strong conceptual foundation. Our Class 12 Computer Science solutions follow a detailed, step-by-step approach to ensure you understand the logic behind every answer. Practicing these Chapter 4 Queue solutions will improve your exam performance.

Class 12 Computer Science Chapter 4 Queue NCERT Solutions PDF

Question : Define member function delque() to perform delete operation on a linked queue where each node has the following structure :
struct node
{
char name[20]
int marks;
node *link;
};
class queue
{
node *front,‘rear;
public :
queue() {front=rear=NULL;
}
void delque ( );
}; 
Answer:

void queue : : delque ()
{
if ( front != NULL)
{
node *Temp = front;
cout << Temp -> name << Temp
->marks;
front = front->link;
delete Temp;
if(front == NULL)
rear = NULL;
}
else
cout << "Queue is empty";
}

Question : Give the necessary declaration of linked’ implemented Queue containing player’s 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]

Question : Write a function QDELETE ( ) in C++ to perform delete operation on a Linked Queue, which contains Passenger no and Passenger name. Consider the following definition of Node in thecode,
struct node
{
long int Pno;
char Pname [20];
node *Link;
}; 
Answer:

//Function to delete queue elements Node * QUEUE (Node * front, int val, char vail [])

{
Node *temp;
if (front == NULL)
cout <<"Queue Empty";
else
{
temp = front;
temp®Pno=val;
strcpy (temp®Pname, vail);
front = front®Link;
delete temp;
}
return (front);
} [4]

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);
} [4]

Question : Write a function in C++ to perform Insert operation in a circular Queue containing Layer’s information (represented with the help of an array of structure Player).  
struct Player
{
long PID; //Player ID
char Pname [20];} //Player Name
Player*Link;
}
Answer:

void Insert ( )
{
PLAYER *P = new PLAYER;
cout <<"Enter Player ID & Name";
cin>>P→PID;
gets (P→ Pname);
P®Link=NULL;
if ((fronts = NULL) && (rear == NULL))
{
front = rear = P;
}
else
{
rear®Link = P;
rear = P;
}
} [4]

Question : Write a function in C++ to perform insert operation in a static circular queue containing book’s information (represented with the help of an array of structure BOOK).
struct BOOK
{
long Accno; //Book Accession Number char Title[20]; //Book Title
};
Answer:

struct BOOK
{
long Accno; char Title [20] ;
int front, rear;
}B [10] ;

void insert()
{
if (r e a r = = s i z e - l & & f r o n t = = 0||front== rear+1)
{
cout<<"\n Circular queue is full"; return;
}
else if(rear==-l)
{
rear++;
front++;
}
else if(rear==size-1)
rear=0;
else
{
rear++;
}
cout<<"Enter Title : ” ;
cin>>B[rear] . Title;
cout<<"Enter Accno : ” ;
cin>>B[rear] . Accno;
} [4]

Question : Write a function in C++ to perform insert operation in a dynamic queue containing DVD’s information (represented with the help of an array of structure DVD).
Answer:
/*Function in C++ to perform insert in a dynamic queue is given as*/
struct DVD
{
long No; // DVD Number
char Title[20]; // DVD Title
DVD *Link
};
void insert(struct DVD *start, char data[20] ) ;
{
DVD *q, *temp;
// Dynamic memory has been allocated for a node
temp=(DVD*)malloc(size of (DVD));
temp=Title[20]=data[20] ;
temp"Next=NULL;
if (start = = NULL) /*Element
inserted at end*/
while (q"Next ! = NULL)
q=q.Next;

q.Next = temp;
} [4]

Question : Write the definition of a member function INSERT() for a class QUEUE in C++, to insert a CUSTOMER in a dynamically allocated Queue of items considering the following code which is already written as a part of the program,
struct CUSTOMER
{
int CNO; char CNAME[20];
CUSTOMER *Link;
};
Class QUEUE
{
CUSTOMER *R,*F;
Public:
QUEUE(){R=NULL;F=NULL;}
void INSERT();
void DELETE()
-QUEUE();
}; 
Answer:

void QUEUE : : INSERT ()
{
CUSTOMER*T=New CUSTOMER;
cin>>T>>;
gets(T→CNAME);
//OR cin>>T>>CNAME;
T → LINK = NULL;
if (R==NULL)
{
F=T; R=T;
}
else
{ R → LINK = T; R = T;
}
}

 

NCERT Solutions Class 12 Computer Science Chapter 4 Queue

Students can now access the NCERT Solutions for Chapter 4 Queue prepared by teachers on our website. These solutions cover all questions in exercise in your Class 12 Computer Science textbook. Each answer is updated based on the current academic session as per the latest NCERT syllabus.

Detailed Explanations for Chapter 4 Queue

Our expert teachers have provided step-by-step explanations for all the difficult questions in the Class 12 Computer Science chapter. Along with the final answers, we have also explained the concept behind it to help you build stronger understanding of each topic. This will be really helpful for Class 12 students who want to understand both theoretical and practical questions. By studying these NCERT Questions and Answers your basic concepts will improve a lot.

Benefits of using Computer Science Class 12 Solved Papers

Using our Computer Science solutions regularly students will be able to improve their logical thinking and problem-solving speed. These Class 12 solutions are a guide for self-study and homework assistance. Along with the chapter-wise solutions, you should also refer to our Revision Notes and Sample Papers for Chapter 4 Queue to get a complete preparation experience.

Where can I find the latest [current-page:node:field_title] for the 2025-26 session?

The complete and updated is available for free on StudiesToday.com. These solutions for Class 12 Computer Science are as per latest NCERT curriculum.

Are the Computer Science NCERT solutions for Class 12 updated for the new 50% competency-based exam pattern?

Yes, our experts have revised the as per 2026 exam pattern. All textbook exercises have been solved and have added explanation about how the Computer Science concepts are applied in case-study and assertion-reasoning questions.

How do these Class 12 NCERT solutions help in scoring 90% plus marks?

Toppers recommend using NCERT language because NCERT marking schemes are strictly based on textbook definitions. Our will help students to get full marks in the theory paper.

Do you offer [current-page:node:field_title] in multiple languages like Hindi and English?

Yes, we provide bilingual support for Class 12 Computer Science. You can access in both English and Hindi medium.

Is it possible to download the Computer Science NCERT solutions for Class 12 as a PDF?

Yes, you can download the entire in printable PDF format for offline study on any device.