program to Reverse a linked list

Answer Posted / gaurav jain

void reverse(struct node **kbr)
{
struct node *temp,*p,*q;
temp=*kbr;
p=temp->next;
q=temp;
while(p!=NULL)
{
temp=p;
p=p->next;
temp->next=q;
q=temp;
}
(*kbr)->next=NULL;
*kbr=q;
}

Is This Answer Correct ?    24 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

2395


Develop a routine to reflect an object about an arbitrarily selected plane

2976


How can you relate the function with the structure? Explain with an appropriate example.

2909


Cluster head selection in Wireless Sensor Network using C programming language.

3092


How to palindrom string in c language?

8781






write a simple calculator c program to perform addition, subtraction, mul and div.

3127


Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??

1765


Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines

3014


write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??

4127


Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?

3837


Write a program to model an exploding firecracker in the xy plane using a particle system

3677


how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns

3112


Write a routine to implement the polymarker function

4367


could you please send the program code for multiplying sparse matrix in c????

3060


how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.

2130