#c program to implement circular queue
Explore tagged Tumblr posts
Video
youtube
Circular Queue - Insertion/Deletion - With Example in Hindi
This is a Hindi video tutorial that Circular Queue - Insertion/Deletion - With Example in Hindi. You will learn c program to implement circular queue using array in hindi, circular queue using array in c and circular queue in c using linked list. This video will make you understand circular queue tutorialspoint, circular queue algorithm, circular queue example, circular queue in data structure pdf, insertion and deletion in circular queue in data structure, implement circular queue in hindi, circular queue c, types of queue in hindi, double ended queue in hindi. If you are looking for Circular Queue in Hindi, Circular Queue Array Implementation in Hindi, Circular Queue Programming using Array (Hindi), Circular Queue | Data Structures in Hindi or Array Implementation of Circular Queue in Hindi, then this video is for you. You can download the program from the following link: http://bmharwani.com/circularqueuearr.c For more videos on Data Structures, visit: https://www.youtube.com/watch?v=TRXkTGu0n9g&list=PLuDr_vb2LpAxZdUV5gyea-TsEJ06k_-Aw&index=14 To get notification for latest videos uploaded, subscribe to my channel: https://youtube.com/c/bintuharwani To see more videos on different computer subjects, visit: http://bmharwani.com
#circular queue in hindi#circular queue in c#implement circular queue using array#circular queue tutorial#how to implement circular queue using array#circular queue using array with output#use of modulo operator in circular queue#circular queue using array example#circular queue algorithm#circular queue tutorialspoint#circular queue ppt#bintu harwani#b.m. harwani#circular queue using array#circular queue#c program to implement circular queue#circular queue program#types of queue
0 notes
Photo
Circular Queue Data Structure with C++ Program Implementation | Data Structures & Algorithms http://ehelpdesk.tk/wp-content/uploads/2020/02/logo-header.png [ad_1] A circular queue data structure ... #academics #ccircularqueue #calculus #chineselanguage #circularqueue #circularqueuec #circularqueuedatastructure #circularqueueindatastructureusingc #datastructure #datastructures #datastructuresandalgorithms #englishconversation #englishgrammar #englishlanguage #frenchlanguage #germanlanguage #howcircularqueueworks #howtoimplementcircularqueueinc #ielts #japaneselanguage #linearalgebra #math #probability #queuedatastructure #signlanguage #spanishlanguage #statistics #teaching #thebible #whatiscircularqueue
0 notes
Link
0 notes
Text
Data Structure & Algorithms Tuition Near Sector 52 Noida
Data Structure & Algorithms Tuition Near Sector 52 Noida
Data Structure & Algorithms Tuition Near Sector 52 Noida
Call For The Best B.Tech Tuition Tutor Near Sector-52 Noida. Tuition Classes are available for all subjects of Mechanical, Electrical, Civil, Electronic, Computer Science.
Abstract Data Types, Sequences as value definitions, Data types in C, Pointers in C, Data Structures and C, Arrays in C, Array as ADT, One Dimensional Array, Implementing…
View On WordPress
#Addition of Long Positive Integers on Circular and Doubly Linked List Trees: Binary trees: Operations on Binary Trees#Address Calculation Sort#Allocation of storage and scope of variables#Application of Depth First Traversal#Applications of Binary Trees#Array as ADT#Array as parameters#Array Implementation of Priority Queue#Arrays in C#“Data Structure using C”#“Data Structures and Program Design in C”#“Data structures using C and C++”#“Data Structures With C”#“Introduction to Algorithms“#“Programming in ANSI C&039;#Binary Search#Binary Tree Representation#Binary Tree Traversal in C#Breadth First Traversal#Bruce P. Leung Clovis L. Tondo#C Implementation of Queues#C Representation of Graphs#Circular Lists: Stack and Queue as Circular List -Primitive Operations on circular lists#Civil#Closed Hashing: Linear Probing#Computer Science. Abstract Data Types#Constructing a Tree. Sorting And Searching: General Background of Sorting: Efficiency Considerations#Data Structure & Algorithms Tuition Near Sector 52 Noida Call For The Best B.Tech Tuition Tutor Near Sector-52 Noida. Tuition Classes ar#Data Structures and C#Data types in C
0 notes
Text
program for array implementation of stack, stack through linked list, linked list operations, polynomials as linked list, convert infix to postfix, infix to prefix, queue implementation of array and more
http://www.knowsh.com/Notes/220321/Program-For-Array-Implementation-Of-Stack-Stack-Through-Linked-List-Linked-List-Operations-Polynomials-As-Linked-List-Convert-Infix-To-Postfix-Infix-To-Prefix-Queue-Implementation-Of-Array-And-More
http://www.knowsh.com Array implementation of stack, Implementation of stack through link list, Operation on link list, add two polynomials maintained as linked lists, multiply two polynomials maintained as linked lists, convert an Infix form to postfix form, convert an Infix expression to prefix form, implements queue as an array, implements queue as a linked list, implements circular queue as…
View On WordPress
#add two polynomials maintained as linked lists#Array implementation of stack#c programming#convert an Infix expression to prefix form#convert an Infix form to postfix form#Implementation of stack through link list#implements circular queue as an array#implements queue as a linked list#implements queue as an array#multiply two polynomials maintained as linked lists#Operation on link list
0 notes
Text
C Program to implement circular queue using arrays
Circular queue using arrays Write a C Program to implement circular queue using arrays. Here’s simple Program to implement circular queue using arrays in C Programming Language. What is Queue ? Queue is also an abstract data type or a linear data structure, in which the first element is inserted from one end called REAR, and the deletion of existing element takes place from the other end called…
View On WordPress
#c data structures#c queue programs#circular queue implementation in c using array algorithm#circular queue in c#circular queue in c using array#circular queue operations in data structure#implement circular queue using array in c#implementation of circular queue in c using array#program to implement circular queue using array in c
0 notes
Text
NCERT Class 12 Computer Science Chapter 10 Queue
NCERT Class 12 Computer Science C++ Solutions for Chapter 10 Queue
Long Answer Type Questions [4 marks each]
Question 1:
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 ( ); }; [CBSE Comptt., 2014]
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"; } (4 marks for correct program)
Question 2: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. [CBSE Comptt., 2013]
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 3: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 the code,
struct node { long int Pno; char Pname [20]; node *Link; }; [O.D, 2013]
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 4: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 ().�� [Delhi, 2013]
struct Node { long int Cno; // Client No char Cname [20]; // Client Name Node *Next ; };
Answer:Function to Insert elementNode * 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 5: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). [CBSE SQP 2013]
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 6: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). [O.D, 2012]
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 7: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). [Delhi, 2012]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 8: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(); }; [CBSE SQP 2013]
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; } }
(1 Mark for correct a new code)(1/2 Mark for entering data to new code)(1/2Mark for assigning NULL to link of the new code)(1/2 Mark for assigning front to the first code as L=T)(1/2 Mark for linking the last node to new code as R→Link=T)(1 Mark for assign Read to the new code as R=T)
from Blogger http://www.margdarsan.com/2020/09/ncert-class-12-computer-science-chapter_3.html
0 notes
Link
Data Structures and Algorithms in C programming language – coding interviews questions/projects. Linked List, Recursion
DATA STRUCTURES
Created by Deepali Srivastava
Last updated 8/2019
English
English Subs [Auto-generated]
What you’ll learn
Understand the details of Data Structures and algorithms through animations
Learn to write programs for different Data Structures and Algorithms in C language
Get the confidence to face programming interviews
Test your knowledge with over 100 Quiz questions
Learn how to analyse algorithms
Get the ability to write and trace recursive algorithms
Requirements
Basic knowledge of programming in any language
Description
This “Data Structures and Algorithms In C” course is thoroughly detailed and uses lots of animations to help you visualize the concepts.
Subtitles are available for the first section only. Closed Captioning for rest of the sections is in progress and are available as [Auto-generated].
This “Data Structures and Algorithms in C” tutorial will help you develop a strong background in Data Structures and Algorithms. The course is broken down into easy to assimilate short lectures, and after each topic there is a quiz that can help you to test your newly acquired knowledge. The examples are explained with animations to simplify the learning of this complex topic. Complete working programs are shown for each concept that is explained.
This course provides a comprehensive explanation of structures like linked lists, stacks and queues, binary search trees, heap, searching, hashing. Various sorting algorithms with implementation and analysis are included in this tutorial. Concept of recursion is very important for designing and understanding certain algorithms so the process of recursion is explained with the help of several examples.
This course covers following topics with C language implementation :
Algorithm Analysis, Big O notation, Time complexity, Singly linked list, Reversing a linked list, Doubly linked list, Circular linked list, Linked list concatenation, Sorted linked list.
Stack, Queue, Circular Queue, Dequeue, Priority queue, Polish Notations, Infix to Postfix, Evaluation of Postfix, Binary Tree, Binary Search Tree, Tree Traversal (inorder, preorder, postorder, level order), Recursion, Heap, Searching, Hashing
Sorting : Selection, Bubble, Insertion, Shell, Merging, Recursive Merge, Iterative Merge, Quick, Heap, Binary tree, Radix, Address calculation sort
Throughout the course, a step by step approach is followed to make you understand different Data Structures and Algorithms. You will see implementation of different data structures in C language and algorithms are explained in step-wise manner. Through this course you can build a strong foundation and it will help you to crack Data Structures and Algorithms coding interviews questions and work on projects. Good foundation on Data Structures and Algorithms interview topics helps you to attempt tricky interview questions.
In this Data Structures and Algorithms course, C language is used for implementing various concepts, but you can easily implement them in any other programming languages like C++, C#, Java, Python.
What students are saying about this course-
“This is exactly how I hoped to learn data structure and algorithm, PLUS, it’s using C!!”
“Instructor is teaching in very well and efficient manner with a good pace ,clears every doubts and teaches concepts deeply.”
“Great class, explains topics very well, better than any college class I ever took.”
“yes this course has helped me a lot in discovering new topics and the example programs are also quite helpful.”
“I really appreciate the way the steps are broken down incrementally.”
“Deepali does a great job in explaining all the concept and the course is very well organized. First the concept is explained on paper and then there is a walk through of the code, and then execution of the code. I have learnt a great deal from this course.”
“I am taking notes and writing code side by side watching videos which makes it beneficial to understand the code and easier to grasp the concept of the topic rather than just copying the source code. Thank you Deepali Mam for not giving the source it was better to write the code by myself. The videos are informative, detailed and right on point with step by step code programs and I feel learned a lot taking your course then the class which I took at University. This course made my base of data structures in C pretty strong thank you for that.”
“This is an awesome course. If you need to understand then try to write every code yourself then try to analyze it. that’s how you can gain confidence.”
“I’m re-learning something what I am learn years ago, and this course is perfect for my need.”
“Its quite helpful, it nicely supplements what you have studied in the book.”
“Excellent presentation and content. Easily comprehensible. Since Data Structures and Algorithms are heart of computer science will give a 5 star for this kind of knowledge resource.”
“It is one of the best courses that I have ever taken in Structures and C.”
“Good foundation course covering the fundamentals of structures in C.”
“It’s definitely a good course for beginners who have basic knowledge in C and want to learn Data Structures and Algorithms. Really good explanation by the instructor with experience of even writing a book on Data structures.”
“Till now its above expectations.Mam I am also following your both book “C in Depth” and “Data Structure Using C”.”
“Great in depth explanations of the data structures and algorithms covered.”
“good and perfect teaching for basic levels for beginners in data structures.”
“Very good clarification and reference for common data structures and algorithms.”
This Data Structures and Algorithms In C online course on udemy will help software developers to refresh the concepts studied in book / pdf and also to students learning from referred book / pdf.
Who this course is for:
Programmers looking for jobs
Programmers wanting to write efficient code
Computer Science students having Data Structures as part of their curriculum
Non Computer science students wanting to enter IT industry
Size: 752MB
DOWNLOAD TUTORIAL
The post DATA STRUCTURES AND ALGORITHMS THROUGH C IN DEPTH appeared first on GetFreeCourses.Me.
0 notes
Link
0 notes
Text
C Program to implement queue using circular linked list
Queue using circular linked list Write a C Program to implement queue using circular linked list. Here’s simple Program to implement queue using circular linked list in C Programming Language. What is Queue ? Queue is also an abstract data type or a linear data structure, in which the first element is inserted from one end called REAR, and the deletion of existing element takes place from the…
View On WordPress
#circular queue in c using linked list#circular queue in data structure#circular queue using linked list#circular queue using linked list in c#queue in linked list in c#queue using circular linked list#queue using linked list in data structure#simple c program to implement circular queue using linked list
0 notes
Text
NCERT Class 12 Computer Science Chapter 10 Queue
NCERT Class 12 Computer Science C++ Solutions for Chapter 10 Queue
Long Answer Type Questions [4 marks each]
Question 1:
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 ( ); }; [CBSE Comptt., 2014]
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"; } (4 marks for correct program)
Question 2: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. [CBSE Comptt., 2013]
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 3: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 the code,
struct node { long int Pno; char Pname [20]; node *Link; }; [O.D, 2013]
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 4: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 (). [Delhi, 2013]
struct Node { long int Cno; // Client No char Cname [20]; // Client Name Node *Next ; };
Answer:Function to Insert elementNode * 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 5: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). [CBSE SQP 2013]
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 6: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). [O.D, 2012]
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 7: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). [Delhi, 2012]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 8: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(); }; [CBSE SQP 2013]
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; } }
(1 Mark for correct a new code)(1/2 Mark for entering data to new code)(1/2Mark for assigning NULL to link of the new code)(1/2 Mark for assigning front to the first code as L=T)(1/2 Mark for linking the last node to new code as R→Link=T)(1 Mark for assign Read to the new code as R=T)
via Blogger https://ift.tt/3bY1BAU
0 notes
Text
NCERT Class 12 Computer Science Chapter 10 Queue
NCERT Class 12 Computer Science C++ Solutions for Chapter 10 Queue
Long Answer Type Questions [4 marks each]
Question 1:
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 ( ); }; [CBSE Comptt., 2014]
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"; } (4 marks for correct program)
Question 2: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. [CBSE Comptt., 2013]
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 3: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 the code,
struct node { long int Pno; char Pname [20]; node *Link; }; [O.D, 2013]
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 4: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 (). [Delhi, 2013]
struct Node { long int Cno; // Client No char Cname [20]; // Client Name Node *Next ; };
Answer:Function to Insert elementNode * 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 5: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). [CBSE SQP 2013]
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 6: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). [O.D, 2012]
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 7: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). [Delhi, 2012]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 8: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(); }; [CBSE SQP 2013]
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; } }
(1 Mark for correct a new code)(1/2 Mark for entering data to new code)(1/2Mark for assigning NULL to link of the new code)(1/2 Mark for assigning front to the first code as L=T)(1/2 Mark for linking the last node to new code as R→Link=T)(1 Mark for assign Read to the new code as R=T)
via Blogger https://ift.tt/3bY1BAU
0 notes
Photo
This video tutorial is on how to create a circular queue using array. This tutorial on data structures is for beginners and will make you understand how to implement a circular queue, how to create a circular queue in c using array and circular queue program in c using array. You will understand the complete program and will learn about, circular queue tutorialspoint, circular queue in data structure pdf along with circular queue example. By the end of video you will be knowing, circular queue in C using Array, circular queue in data structures and C program to implement circular queue operations. The tutorial explains with figures at each step and will make you understand the program to implement circular queue using arrays in C, circular queue implementation in C using array and circular queue implementation using array in C along with circular queue algorithm and insertion and deletion in circular queue in data structure too. You can download the program from the following link: http://bmharwani.com/circularqueuearr.c To see the video on linear queue, visit: https://www.youtube.com/watch?v=_OD_BHiDTWk&t=10s To understand pass by value and pass by reference, visit: https://www.youtube.com/watch?v=NIV7M4MSLs4&t=18s To see the video on circular linked list, visit: https://www.youtube.com/watch?v=lg-n_NHAeZk&t=1s For more videos on Data Structures, visit: https://www.youtube.com/watch?v=lg-n_NHAeZk&list=PLuDr_vb2LpAxVWIk-po5nL5Ct2pHpndLR To get notification for latest videos uploaded, subscribe to my channel: https://youtube.com/c/bintuharwani To see more videos on different computer subjects, visit: http://bmharwani.com
#circular queue#circular queues#circular array#queue using circular array#yt:cc=on#bintu harwani#circular queue in c#circular queue algorithm#circular queue using array#implement circular queue#use of modulo operator in circular queue#modulo in circular queue#circular arrays#circulararray#circular queue ppt#circular queue tutorialspoint#circular queue c++#circular queue geeksforgeeks#circular queue using c++#implement a circular queue using array
0 notes
Text
C Program to implement Deque using circular array
Implement Deque using circular array Write a C Program to implement Deque using circular array. Here’s simple Program to implement Deque using circular array in C Programming Language. What is Queue ? Queue is also an abstract data type or a linear data structure, in which the first element is inserted from one end called REAR, and the deletion of existing element takes place from the other end…
View On WordPress
#c data structures#c queue programs#dequeue in c using arrays#dequeue in data structure using c#dequeue in data structure with example#dequeue program in c using array#double ended queue in c#double ended queue in c using arrays#double ended queue in data structure#double ended queue in data structure program
0 notes
Text
Write a C++ Menu Driven Program to implement circular queue using Arrays
C++ Menu Driven Program to implement circular queue using Arrays
#include #include using namespace std; class cqueue { int q[5],front,rare; public: cqueue() { front=-1; rare=-1; } void push(int x) { if(front ==-1 && rare == -1) { q[++rare]=x; front=rare; return; } else if(front == (rare+1)%5 ) { cout <<" Circular Queue over flow"; return; } rare= (rare+1)%5; q[rare]=x; } void pop() {…
View On WordPress
0 notes