writw a program to insert an element in the begning of a
doubly linked list
Answer / mani
#include<stdio.h>
typedef struct node {
int data;
struct node *leftlink;
struct node *rightlink;
}node;
node *start=NULL;
node *tail=NULL;
void add_begin(node *);
main()
{
.......
.......
add_begin(start);
.......
.......
}
void add_begin(node *temp)
{
node *new_node=NULL;
int idata;
printf("enter the data part value: ");
scanf("%d",&idata);
if(start==NULL && tail==NULL )
{
new_node=(node *)malloc(sizeof(node));
new_node->data=idata;
new_node->leftlink=NULL;
new_node->rightlink=NULL;
start=new_node;
tail=new_node;
}
else
{
new_node=(node *)malloc(sizeof(node));
new_node->data=idata;
temp->leftlink=new_node;
new_node->rightlink=temp;
new_node->leftlink=NULL;
start=newnode;
}
}
Is This Answer Correct ? | 3 Yes | 0 No |
34.what are bitwise shift operators? 35.what are bit fields? What is the use of bit fields in a structure declaration? 36.what is the size of an integer variable? 37.what are the files which are automatically opened when a c file is executed? 38.what is the little endian and big endian? 39.what is the use of fflush() function? 40.what is the difference between exit() and _exit() functions? 41.where does malloc() function get the memory? 42.what is the difference between malloc() and calloc() function? 43.what is the difference between postfix and prefix unary increment operators?
Tell me what are bitwise shift operators?
how to get the starting address of file stored in harddisk through 'C'program.
Write a program to print fibonacci series without using recursion?
How to write a code for reverse of string without using string functions?
What are header files in c?
How would you sort a linked list?
Why is the code below functioning. According to me it MUST NOT.
Is c is a high level language?
What is the full form of getch?
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }