Top Answer

ARRAY-BASED CIRCULAR QUEUE#include #include

class person

{

public:

int arr_tym, trans_tym, wait_tym, deprt_tym;

};

class queue

{

private:

person data[5];

int front , back , count;

public:

queue()

{

front=0;

back=0;

count=0;

}

void Front()

{

cout<<" \n The arrival time of the first customer is :"<

cout<<" \n And the transaction time of the first customer is :"<

}

void enqueue(int a_tym, int t_tym)

{

if(count==5)

cout<<"\n The queue is full. \n";

else if(count<5)

{

data[back].arr_tym=a_tym;

data[back].trans_tym=t_tym;

count++;

if(back==4)

back=0;

else if(back<4)

back++;

}

Front();

}

void dequeue()

{

if(count==0)

cout<<"\n The queue is already empty. \n";

else if(count>0)

{

data[front].arr_tym=0;

data[front].trans_tym=0;

if(front<4)

front+=1;

else if(front==4)

front=0;

cout<<"\n The element has been deleted. \n";

count--;

Front();

}

}

void Is_Empty()

{

if(count==0)

cout<<"\n The queue is empty. \n";

else if(count<5&&count>0)

cout<<"\n The queue has "<

else if(count==5)

cout<<"\n The queue is full. \n";

}

void cal_w8_tym()

{

for(int i=front;i<5;i++)

{

if(i==1)

{

data[i].deprt_tym=data[i].arr_tym+data[i].trans_tym;

data[i].wait_tym=0;

}

else

{

if(data[i].deprt_tym

{

data[i].deprt_tym=data[i].arr_tym+data[i].trans_tym;

data[i].wait_tym=0;

}

else

{

data[i].deprt_tym=data[i-1].deprt_tym+data[i].trans_tym;

data[i].wait_tym=data[i-1].deprt_tym-data[i].arr_tym;

}

}

}

}

void display()

{

cout<<"\n\tARRIVAL TIME\tTRANSACTION TIME\tWAITING TIME\tDEPARTING TIME\n";

for(int i=front;i<5;i++)

{

cout<<"\n\t"<

cout<<"\t"<

cout<<"\t"<

cout<<"\t"<

}

}

void avg_w8_tym()

{

}

};

void main()

{

queue q;

int arr_time,trans_time;

char opt;

do

{

cout<<"\n Enter arrival time of the customer: ";

cin>>arr_time;

cout<<" \n Enter transaction time of the customer: ";

cin>>trans_time;

q.enqueue(arr_time,trans_time);

cout<<"\n Do you want to continue? ";

cin>>opt;

}while(opt=='y');

q.Front();

q.dequeue();

q.Is_Empty();

q.dequeue();

q.cal_w8_tym();

q.display();

}

LINKED LIST BASED CIRCULAR QUEUE

#include

class node

{

public:

int data;

node* link;

};

class queue

{

node* front;

node* back;

public:

queue()

{

front=NULL;

back=NULL;

}

void enqueue(int d)

{

node* ptr;

ptr=new node;

ptr->data=d;

ptr->link=NULL;

if(front==NULL)

{

front=ptr;

back=ptr;

}

else

{

back->link=ptr;

back=back->link;

}

}

void dequeue()

{

node* ptr;

ptr=front;

if(front==NULL)

cout<<"\n Nothing can be deleted. \n";

else

{

ptr=front;

front=front->link;

delete ptr;

ptr=NULL;

cout<<"\n The first element has been deleted.\n";

Front();

}

}

void If_Empty()

{

if(front==NULL)

cout<<"\n The queue is empty.\n ";

}

void Front()

{

if(front!=NULL)

cout<<"\n The first element is "<

}

};

void main()

{

queue q;

int data;

char opt;

do

{

cout<<" Enter your data:\t";

cin>>data;

q.enqueue(data);

cout<<"\n Do you want to continue:\t";

cin>>opt;

}while(opt=='y'opt=='Y');

q.Front();

q.dequeue();

q.If_Empty();

q.dequeue();

q.dequeue();

q.If_Empty();

q.dequeue();

}

🙏

0🤨

0😮

0😂

0Loading...

The main operations on singly linked list are: 1:-Insertion 2:-Deletion 3:-Searching 4:-Display Insertion can be done in done ways: 1)Insertion at beginning 2)Insertion at end 3)Inserting at a specified position Deletion can be performed in 3 ways: 1)Deletion from beginning 2)Deletion from end 3)Deletion from a specified position.

Deletion is nothing but eliminating and insertion is adding.

Operations that are performed on a singly linked list are- 1. Traversal of complete list (Displaying all data elements) 2. Insertion of element at beginning. 3. Insertion of element at end. 4. Insertion of element at specified position. 5. Deletion of element from beginning. 6. Deletion of element from end. 7. Deletion of element from specified position.

The queue is a linear data structure where operations of insertion and deletion are performed at separate ends also known as front and rear. Queue is a FIFO structure that is first in first out. A circular queue is similar to the normal queue with the difference that queue is circular queue ; that is pointer rear can point to beginning of the queue when it reaches at the end of the queue. Advantage of this type of queue is that empty location let due to deletion of elements using front pointer can again be filled using rear pointer. A double ended queue (or deque ) is a queue where insertion and deletion can be performed at both end that is front pointer can be used for insertion (apart from its usual operation i.e. deletion) and rear pointer can be used for deletion (apart from its usual operation i.e. insertion)

A standard queue suffers from a rebuffering problem during dequeue operations. By making the queue circular and linking the head to the tail, this alleviates the problem and allows insertion and deletion in constant time.

A circular queue is a Queue but a particular implementation of a queue. It is very efficient. It is also quite useful in low level code, because insertion and deletion are totally independant, which means that you don't have to worry about an interrupt handler trying to do an insertion at the same time as your main code is doing a deletion.

frameshift- deletion and insertion point mutation- sustitution

This has to do with computer programing. You may want to talk with someone who has the knowledge to get the right program.

Data structures could be used to implement an efficient database. Linked lists for example will optimize insertion and deletion for ordered lists.

Insertion, Deletion, and Substitution.

Deletion or Insertion

due i have problem

A double ended queue (or deque ) is a queue where insertion and deletion can be performed at both end that is front pointer can be used for insertion (apart from its usual operation i.e. deletion) and rear pointer can be used for deletion (apart from its usual operation i.e. insertion)

In queue insertion takes place on rear end and deletion takes place on front end. INSERTION(QUEUE,N,FRONT,REAR,ITEM) :QUEUE is the name of a array on which we are implementing the queue having size N. view comlete ans at http://mcabcanotes.in/algorithm-to-perform-insertion-and-deletion-in-a-queue/

The queue is a linear data structure where operations of insertion and deletion are performed at separate ends also known as front and rear. Queue is a FIFO structure that is first in first out. A circular queue is similar to the normal queue with the difference that queue is circular queue ; that is pointer rear can point to beginning of the queue when it reaches at the end of the queue.

The queue is a linear data structure where operations od insertion and deletion are performed at separate ends also known as front and rear. Queue is a FIFO structure that is first in first out. A circular queue is similar to the normal queue with the difference that queue is circular queue ; that is pointer rear can point to beginning of the queue when it reaches at the end of the queue

The queue is a linear data structure where operations of insertion and deletion are performed at separate ends also known as front and rear. Queue is a FIFO structure that is first in first out. A circular queue is similar to the normal queue with the difference that queue is circular queue ; that is pointer rear can point to beginning of the queue when it reaches at the end of the queue.

A double ended queue (or deque ) is a queue where insertion and deletion can be performed at both end that is front pointer can be used for insertion (apart from its usual operation i.e. deletion) and rear pointer can be used for deletion (apart from its usual operation i.e. insertion)

In insertion mutations, an extra base pair is added, and in a deletion, a base pair is taken out (omitted).

Insertion, deletion, and substitution.

substitution deletion insertion

Substitution, Insertion, Deletion

Both of them affect the length.

The queue is a linear data structure where operations of insertion and deletion are performed at separate ends also known as front and rear. Queue is a FIFO structure that is first in first out. A circular queue is similar to the normal queue with the difference that queue is circular queue ; that is pointer rear can point to beginning of the queue when it reaches at the end of the queue. Advantage of this type of queue is that empty location let due to deletion of elements using front pointer can again be filled using rear pointer.

A double ended queue (or deque ) is a queue where insertion and deletion can be performed at both end that is front pointer can be used for insertion (apart from its usual operation i.e. deletion) and rear pointer can be used for deletion (apart from its usual operation i.e. insertion)