Write a C program for Dequeue
#include#include
struct dll
{
struct dll *llink;
int data;
struct dll *rlink;
};
typedef struct dll node;
node *first=NULL, *new;
void create(),insertbeg(),insertmid(),insertend(),insert();
void delbeg(),delmid(),delend(),delete();
void display();
void main()
{
char ch='y';
int c;
clrscr();
while(ch=='y')
{
printf("1. create 2. insert 3. delete 4. display 5.exit\n");
printf("enter u'r choice");
scanf("%d",&c);
switch(c)
{
case 1: create();break;
case 2: insert();break;
case 3: delete();break;
case 4: display();
}
printf("do u want to continue(y/n)");
fflush(stdin);
scanf("%c",&ch);
}
}
void create()
{
node *temp;
char ch='y';
temp=first;
do
{
printf("enter the data for new node\n");
new=(node *)malloc(sizeof(node));
scanf("%d",&new->data);
if(first==NULL)
{
first=new;
temp=new;
new->llink=NULL;
new->rlink=NULL;
}
else
{
temp->rlink=new;
new->llink=temp;
new->rlink=NULL;
temp=new;
}
printf("do u wnat to create another node(y/n)");
ch=getchar();
fflush(stdin);
}while(ch!='n');
}
void insert()
{
char ch='y';
int c;
while(ch=='y')
{
printf("1.insertbeg 2: insertmid 3. insertend 4. exit\n");
printf("enter u'r option");
scanf("%d",&c);
switch(c)
{
case 1:insertbeg();break;
case 2:insertmid();break;
case 3:insertend();
}
printf("do u want to continue(y/n)");
fflush(stdin);
ch=getchar();
}
}
void insertbeg()
{
printf("enter data for node to aded in the beginnning");
new=(node *)malloc(sizeof(node));
scanf("%d",&new->data);
if(first==NULL)
{
first=new;
new->llink=NULL;
new->rlink=NULL;
}
else
{
new->rlink=first;
first->llink=new;
new->llink=NULL;
first=new;
}
}
void insertmid()
{
int pos,i=1;
node *temp;
temp=first;
printf("enter the positon to insert a node");
scanf("%d",&pos);
printf("enter data for node to be added at a positon %d",pos);
new=(node *)malloc(sizeof(node));
scanf("%d",&new->data);
while(i {
temp=temp->rlink;
i++;
}
temp->rlink->llink=new;
new->rlink=temp->rlink;
temp->rlink=new;
new->llink=temp;
}
void insertend()
{
node *temp;
temp=first;
printf("enter data for node to be aded at end");
new=(node *)malloc(sizeof(node));
scanf("%d",&new->data);
while(temp->rlink!=NULL)
{
temp=temp->rlink;
}
temp->rlink=new;
new->llink=temp;
new->rlink=NULL;
}
void delete()
{
char ch='y';
int c;
while(ch=='y')
{
printf("1. delbeg 2. delmid 3. delend 4. exit\n");
printf("enter u'r option");
scanf("%D",&c);
switch(c)
{
case 1: delbeg();break;
case 2: delmid();break;
case 3: delend();break;
}
printf("do u want to continue(y/n)");
ch=getchar();
}
}
void delbeg()
{
node *temp;
if(first==NULL)
{
printf("deletion not possible");
exit();
}
else
{
first=first->rlink;
first->llink=NULL;
}
}
void delmid()
{
int pos,i=1;
node *temp;
temp=first;
printf("enter the position to delete a node");
scanf("%d",&pos);
while(i {
temp=temp->rlink;
i++;
}
temp->rlink->rlink->llink=temp;
temp->rlink=temp->rlink->rlink;
}
void delend()
{
node * temp;
temp=first;
while(temp->rlink->rlink!=NULL)
{
temp=temp->rlink;
}
temp->rlink->llink=NULL;
temp->rlink=NULL;
}
void display()
{
node *temp;
if(first==NULL)
{
printf("linked list is empty");
exit();
}
else
{
printf("the contents of dd are :\n");
temp=first;
while(temp->rlink!=NULL)
{
printf("%d",temp->data);
temp=temp->rlink;
}
}
}
write a program by using queue for together two queue?
Don't write, it is already written, google for 'cpp'.
You are not able to do that, but you can write a program, that uses the system-call./* exectest.c */#include int main (void){execlp ("/bin/ls", "ls", "-ld", ".", NULL);return 0;}
JavaScript is one program that has been written in C to implement the Apriori algorithm. There are also several other known programs available on the Internet that implement it as well.
y=2x2+3x+1
There is no need to write a C program for circuit analysis; there are lots of packages out there that already do that (for example, Spice).
to implement operations on binary heap in c
A program in c language to implement framing methods like character stuffing can be grave sizeCRC-32 and the variable c50.
Don't write, it is already written, google for 'cpp'.
You are not able to do that, but you can write a program, that uses the system-call./* exectest.c */#include int main (void){execlp ("/bin/ls", "ls", "-ld", ".", NULL);return 0;}
JavaScript is one program that has been written in C to implement the Apriori algorithm. There are also several other known programs available on the Internet that implement it as well.
Here's a full tutorial of how to implement and build the program. Great Stuff! See below
pro c language to implement linear search using pointers
a c program for creat a virus
y=2x2+3x+1
Into the source program.
#include<deque> std::deque<int> deq; deq.push_back (42); deq.pop_back (); deq.push_front (0); deq.pop_front ();
Write a c program to compute the surface area and volume of a cube