SlideShare a Scribd company logo
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || GET 100% MARKS IN CS
GET 100% MARKS IN
COMPUTER SCIENCE
STACK FUNCTION WRITING
EXAM POINT OF VIEW
EXAM WEIGHTAGE-3/4MARKS
QUEUE INTRODUCTION
• QUEUE IS AN APPLICATION OF LINKED
LIST.
• QUEUE IS A LINK LIST WITH SOME
RESTRICTION ON INSERTION AND
DELETION.
• QUEUE FOLLOWS FIFO
ARCHITECTURE
• (FIFO) FIRST IN FIRST OUT (ELEMENT
WHICH IS INSERTED AT FIRST WILL BE
DELETED FIRST FROM QUEUE)
• INSERTION AND DELETION WILL TAKE
PLACE FROM THE DIFFERENT ENDS.
QUEUE TERMINOLOGIES
*front/*f = a pointer named front/f which is used to point the first
element of queue
*rear/*r=a pointer named rear/r which is used to point the last element of
queue
QINSERT() = Insertion function of queue
QDELETE()= Deletion function of queue
WRITE QINSERT() FUNCTION OF
QUEUE
Q.) WRITE A FUNCTION QINSERT() TO PERFORM INSERTION IN A
DYNAMIC QUEUE. CONSIDERING THE FOLLOWING STACK
struct QUEUE
{
int stu_no;
char stu_name[20];
float perc;
QUEUE *next;
} *front=NULL,*rear=NULL;
EXAM QUESTION TYPE 1
SOLUTION
void QINSERT()
{
QUEUE *temp=new QUEUE;
cout<<"Enter Details of new studentnn";
cout<<"Enter Student No.t:t";
cin>>temp->stu_no;
cout<<"Enter Student Namet:t";
gets(temp->stu_name);
cout<<"Enter Percentage";
cin>>temp->perc;
temp->next=NULL;
if(front ==NULL&&rear==NULL)
{
front=rear =temp;
}
else
{
rear->next=temp;
rear=temp;
}
}
WRITE QDELETE() FUNCTION OF STACK
Q.) WRITE A FUNCTION QDELETE() TO PERFORM DELETION IN A
DYNAMIC QUEUE. CONSIDERING THE FOLLOWING STACK
struct QUEUE
{
int stu_no;
char stu_name[20];
float perc;
Stack *next;
} *front=NULL,*rear=NULL;
EXAM QUESTION TYPE
2
SOLUTION
void QDELETE()
{
if(front ==NULL&& rear==NULL)
{
cout<<"Underflow !!!n";
}
else
{
QUEUE *temp = front;
cout<<“Deleted Node Infon”;
cout<<"Student No.t:t“<<temp->stu_no;
cout<<“Student Namet:t<<temp->stu_name;
cout<<"Enter Percentage“<<temp->perc;
if(front==rear)
{
front=rear=NULL;
}
else
{
front=front->next;
}
delete temp;
}
}
THINGS TO REMEMBER
1.) CHECK UNDERFLOW BEFORE DELETION .
2.) TAKE INPUT OF ALL ELEMENTS OF NODE WHILE INSERTION BY USER.
3.) DISPLAY ALL ELEMENT/INFORMATION OF DELETING NODE INFO
BEFORE DELETION.
4.) CHECK THE NAME OF POINTER LINK/NEXT AND USE THE SAME IN
YOUR SOLUTION.
5.) NAME OF QUEUE(STRUCTURE) FOR CREATING NEW NODE.
QUESTION FOR PRACTICE
Q.1) Write function QINSERT() in C++ to insert a book information in a dynamically
allocated QUEUE of books. Considering the following Structure book.
struct book
{
int bookid;
char bookname[20];
book *next;
};
QUESTION FOR PRACTICE
Q.2) Write function QDELETE() in C++ to perform deletion of a book information in
a dynamically allocated QUEUE of books. Considering the following Structure book.
struct book
{
int bookid;
char bookname[20];
book *next;
};
•SOLVE THE PRACTICE QUESTION AND
PASTE THE ANSWER AS COMMENT IN
COMMENT BOX.
THANKS FOR WATCHING MY VIDEO
EMAIL : theaakashkumar@gmail.com

More Related Content

PPTX
STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...
PPTX
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
PPTX
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
PPTX
Tail Recursion in data structure
PPT
Doublylinklist
PPT
Application of Stacks
PPT
Removal Of Recursion
PDF
please sir i want to comments of every code what i do in eachline . in this w...
STACK || FUNCTION WRITING BASED ON STACK || DATA STRUCTURE || LINKED LIST || ...
2 d array(part 2) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
2 d array(part 1) || 2D ARRAY FUNCTION WRITING || GET 100% MARKS IN CBSE CS
Tail Recursion in data structure
Doublylinklist
Application of Stacks
Removal Of Recursion
please sir i want to comments of every code what i do in eachline . in this w...

What's hot (19)

PDF
Recursion concepts by Divya
PPTX
2.2 stack applications Infix to Postfix & Evaluation of Post Fix
PDF
Stack concepts by Divya
PPT
Infix prefix postfix
PPTX
Queue Implementation Using Array & Linked List
PPTX
My lecture infix-to-postfix
PPT
Stack and queue
PPT
Queue implementation
PPTX
Prefix, Infix and Post-fix Notations
PPT
Circular queues
PDF
Activity Recognition Through Complex Event Processing: First Findings
PPTX
Stack_Application_Infix_Prefix.pptx
PPTX
4Developers 2015: Clean JavaScript code - only dream or reality - Sebastian Ł...
PDF
PDF
A formalization of complex event stream processing
PPT
Stack Data Structure V1.0
PDF
Data structure lab manual
DOCX
Matlab project
PPT
Expression evaluation
Recursion concepts by Divya
2.2 stack applications Infix to Postfix & Evaluation of Post Fix
Stack concepts by Divya
Infix prefix postfix
Queue Implementation Using Array & Linked List
My lecture infix-to-postfix
Stack and queue
Queue implementation
Prefix, Infix and Post-fix Notations
Circular queues
Activity Recognition Through Complex Event Processing: First Findings
Stack_Application_Infix_Prefix.pptx
4Developers 2015: Clean JavaScript code - only dream or reality - Sebastian Ł...
A formalization of complex event stream processing
Stack Data Structure V1.0
Data structure lab manual
Matlab project
Expression evaluation
Ad

Similar to QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || GET 100% MARKS IN CS (20)

DOCX
Stack q ll algo
PPTX
Stack, queue, linked list
PPTX
Stack, Queue, Linked List.pptx
PPTX
Data Structures Lab 8.pptx
PDF
Data StructuresPLEASE USING THIS C++ PROGRAM BELOW, I NEED HEL.pdf
DOCX
PPTX
Unit 2 dsuc(Stacks and Queue)
PDF
Queues-and-CQueue-Implementation
PDF
05 queues
PDF
DSU summer 19.pdf
PPT
Data Structure and Algorithms Queues
PPTX
Queue-Data Structure
PPT
Unit 2 linked list and queues
PDF
Stacks queues
PPTX
DSA_Ques ewoifhjerofhefhehfreofheek.pptx
PPTX
Queues in C++
PPT
Link list part 2
PPTX
PPT Lecture 3.3.1 queue newccccccccccc.pptx
PPT
queue (1).ppt queue notes and ppt in Data Structures
PPTX
Data Structures and Agorithm: DS 09 Queue.pptx
Stack q ll algo
Stack, queue, linked list
Stack, Queue, Linked List.pptx
Data Structures Lab 8.pptx
Data StructuresPLEASE USING THIS C++ PROGRAM BELOW, I NEED HEL.pdf
Unit 2 dsuc(Stacks and Queue)
Queues-and-CQueue-Implementation
05 queues
DSU summer 19.pdf
Data Structure and Algorithms Queues
Queue-Data Structure
Unit 2 linked list and queues
Stacks queues
DSA_Ques ewoifhjerofhefhehfreofheek.pptx
Queues in C++
Link list part 2
PPT Lecture 3.3.1 queue newccccccccccc.pptx
queue (1).ppt queue notes and ppt in Data Structures
Data Structures and Agorithm: DS 09 Queue.pptx
Ad

More from AAKASH KUMAR (20)

PPTX
NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...
PPTX
Inheritance question
PPTX
Header file BASED QUESTION- CBSE CS CLASS 12TH
PPTX
Constructor & destructor based question- cbse cs class 12th
PPTX
CHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAM
PPTX
Practical exam special- CBSE CS CLASS 12th
PPTX
Inheritance question class 12th
PPT
Ms word Part 2
PPT
Ms word Part 1
PPTX
Power point2007instruction
PPT
Html introduction Part-2
PPT
Html Slide Part-1
PPT
Evolution / history of Computer
PPTX
computer system
PPTX
Array within a class
PPTX
Input Output Devices and Memory Unit
PPTX
C++ programming Unit 5 flow of control
PPTX
c++ programming Unit 4 operators
PPTX
c++ programming Unit 3 variables,data types
PPTX
c++ programming Unit 2 basic structure of a c++ program
NETWORKING AND COMMUNICATION || SLIDE 1 || TOPOLOGY AND PLACEMENT OF DEVICES|...
Inheritance question
Header file BASED QUESTION- CBSE CS CLASS 12TH
Constructor & destructor based question- cbse cs class 12th
CHOOSE THE CORRECT IDENTIFIER - Q.1 CBSE CS EXAM
Practical exam special- CBSE CS CLASS 12th
Inheritance question class 12th
Ms word Part 2
Ms word Part 1
Power point2007instruction
Html introduction Part-2
Html Slide Part-1
Evolution / history of Computer
computer system
Array within a class
Input Output Devices and Memory Unit
C++ programming Unit 5 flow of control
c++ programming Unit 4 operators
c++ programming Unit 3 variables,data types
c++ programming Unit 2 basic structure of a c++ program

Recently uploaded (20)

PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
01-Introduction-to-Information-Management.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Pharma ospi slides which help in ospi learning
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Classroom Observation Tools for Teachers
PDF
Complications of Minimal Access Surgery at WLH
PDF
RMMM.pdf make it easy to upload and study
PDF
Insiders guide to clinical Medicine.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Sports Quiz easy sports quiz sports quiz
FourierSeries-QuestionsWithAnswers(Part-A).pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
01-Introduction-to-Information-Management.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Pharma ospi slides which help in ospi learning
PPH.pptx obstetrics and gynecology in nursing
O7-L3 Supply Chain Operations - ICLT Program
Abdominal Access Techniques with Prof. Dr. R K Mishra
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Anesthesia in Laparoscopic Surgery in India
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Classroom Observation Tools for Teachers
Complications of Minimal Access Surgery at WLH
RMMM.pdf make it easy to upload and study
Insiders guide to clinical Medicine.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Sports Quiz easy sports quiz sports quiz

QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || GET 100% MARKS IN CS

  • 2. GET 100% MARKS IN COMPUTER SCIENCE STACK FUNCTION WRITING EXAM POINT OF VIEW EXAM WEIGHTAGE-3/4MARKS
  • 3. QUEUE INTRODUCTION • QUEUE IS AN APPLICATION OF LINKED LIST. • QUEUE IS A LINK LIST WITH SOME RESTRICTION ON INSERTION AND DELETION. • QUEUE FOLLOWS FIFO ARCHITECTURE • (FIFO) FIRST IN FIRST OUT (ELEMENT WHICH IS INSERTED AT FIRST WILL BE DELETED FIRST FROM QUEUE) • INSERTION AND DELETION WILL TAKE PLACE FROM THE DIFFERENT ENDS.
  • 4. QUEUE TERMINOLOGIES *front/*f = a pointer named front/f which is used to point the first element of queue *rear/*r=a pointer named rear/r which is used to point the last element of queue QINSERT() = Insertion function of queue QDELETE()= Deletion function of queue
  • 5. WRITE QINSERT() FUNCTION OF QUEUE Q.) WRITE A FUNCTION QINSERT() TO PERFORM INSERTION IN A DYNAMIC QUEUE. CONSIDERING THE FOLLOWING STACK struct QUEUE { int stu_no; char stu_name[20]; float perc; QUEUE *next; } *front=NULL,*rear=NULL; EXAM QUESTION TYPE 1
  • 6. SOLUTION void QINSERT() { QUEUE *temp=new QUEUE; cout<<"Enter Details of new studentnn"; cout<<"Enter Student No.t:t"; cin>>temp->stu_no; cout<<"Enter Student Namet:t"; gets(temp->stu_name); cout<<"Enter Percentage"; cin>>temp->perc; temp->next=NULL; if(front ==NULL&&rear==NULL) { front=rear =temp; } else { rear->next=temp; rear=temp; } }
  • 7. WRITE QDELETE() FUNCTION OF STACK Q.) WRITE A FUNCTION QDELETE() TO PERFORM DELETION IN A DYNAMIC QUEUE. CONSIDERING THE FOLLOWING STACK struct QUEUE { int stu_no; char stu_name[20]; float perc; Stack *next; } *front=NULL,*rear=NULL; EXAM QUESTION TYPE 2
  • 8. SOLUTION void QDELETE() { if(front ==NULL&& rear==NULL) { cout<<"Underflow !!!n"; } else { QUEUE *temp = front; cout<<“Deleted Node Infon”; cout<<"Student No.t:t“<<temp->stu_no; cout<<“Student Namet:t<<temp->stu_name; cout<<"Enter Percentage“<<temp->perc; if(front==rear) { front=rear=NULL; } else { front=front->next; } delete temp; } }
  • 9. THINGS TO REMEMBER 1.) CHECK UNDERFLOW BEFORE DELETION . 2.) TAKE INPUT OF ALL ELEMENTS OF NODE WHILE INSERTION BY USER. 3.) DISPLAY ALL ELEMENT/INFORMATION OF DELETING NODE INFO BEFORE DELETION. 4.) CHECK THE NAME OF POINTER LINK/NEXT AND USE THE SAME IN YOUR SOLUTION. 5.) NAME OF QUEUE(STRUCTURE) FOR CREATING NEW NODE.
  • 10. QUESTION FOR PRACTICE Q.1) Write function QINSERT() in C++ to insert a book information in a dynamically allocated QUEUE of books. Considering the following Structure book. struct book { int bookid; char bookname[20]; book *next; };
  • 11. QUESTION FOR PRACTICE Q.2) Write function QDELETE() in C++ to perform deletion of a book information in a dynamically allocated QUEUE of books. Considering the following Structure book. struct book { int bookid; char bookname[20]; book *next; };
  • 12. •SOLVE THE PRACTICE QUESTION AND PASTE THE ANSWER AS COMMENT IN COMMENT BOX.
  • 13. THANKS FOR WATCHING MY VIDEO EMAIL : theaakashkumar@gmail.com