can i know the source code for reversing a linked list with
out using a temporary variable?
Answer Posted / abdur rab
struct node* reverse ( struct node* head )
{
struct node* temp;
if ( NULL == head -> next ) temp = head;
else {
temp = reverse ( head -> next );
head -> next -> next = head;
head -> next = NULL;
}
return ( temp );
}
Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
explain what are pointers?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
how to find binary of number?
why programs in c are running with out #include
Where are local variables stored in c?
Explain what is the benefit of using an enum rather than a #define constant?
how can use subset in c program and give more example
while initialization of array why we use a[][2] why not a[2][]...?
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
What is FIFO?
Are the outer parentheses in return statements really optional?
What is #pragma statements?
Is array a primitive data type in c?
What is use of bit field?