CPP Function for insert :
void insert (struct node *head,struct node *p,int newData)
{
struct node *temp = head;
struct node *previous = tail;
struct node *newNode = (struct node *)malloc(sizeof(struct node));
newNode->data = newData;
while(1)
{
if(temp==p)
{
previous->next = newNode;
newNode->prev = previous;
newNode->next = p;
p->prev = newNode;
return ;
}
else
temp=temp->next;
if(temp==head)
{
cout
“Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!”
What Students Are Saying About Us
.......... Customer ID: 12*** | Rating: ⭐⭐⭐⭐⭐"Honestly, I was afraid to send my paper to you, but splendidwritings.com proved they are a trustworthy service. My essay was done in less than a day, and I received a brilliant piece. I didn’t even believe it was my essay at first 🙂 Great job, thank you!"
.......... Customer ID: 14***| Rating: ⭐⭐⭐⭐⭐
"The company has some nice prices and good content. I ordered a term paper here and got a very good one. I'll keep ordering from this website."