can i know the source code for reversing a linked list with
out using a temporary variable?

Answer Posted / ruchi

void reverse()
{
nptr p;
int i=0;
p=start;
while(p->next!=NULL)
{
p=p->next;
i=i+1;
}
i++;
while(i)
{
printf("%d\n",p->num);
p=p->prev;
i--;
}
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is page thrashing?

617


What is floating point constants?

695


Why doesnt that code work?

604


Define the scope of static variables.

608


When should you not use a type cast?

663






What is adt in c programming?

617


What is the difference between arrays and pointers?

638


Explain logical errors? Compare with syntax errors.

633


can any one tel me wt is the question pattern for NIC exam

1562


How do we open a binary file in Read/Write mode in C?

685


Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop

1719


What is the purpose of & in scanf?

606


What is calloc in c?

667


What is a spanning Tree?

967


What is function in c with example?

639