create an SINGLE LINKED LISTS and reverse the data in the
lists completely
Answers were Sorted based on User's Feedback
Answer / akansha sharma
create linklist, with node having DATA which contain
information and NEXT which cointain address of next node.
The pointer START pointing to first node of linklist. PREV
pointer point to first node(where START point) and TEMP
pointer which point at last node(by traversing).
Swap data of TEMP and PREV. Now increment TEMP(TEMP=TEMP-
>NEXT) and decreament TEMP.
Repeat this untill TEMP=PREV
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / vignesh1988i
dear sir ,
your logic might be incorrect , AND GIVE THE FULL PROGRAM SIR
sir you have told that TEMP pointer which point to the last
node.... ok ,for first you can swap the data.... ie STARTING
to TEMP. but how will you arrive at next pair of node for
swapping by decrementing the TEMP , ... a single linked
lists can travel only in one direction from HEAD till NULL
......
THANK U
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / praveen
Push all the elements into a stack (one by one) and then
create a new list by popping of the elements from the stack
| Is This Answer Correct ? | 0 Yes | 0 No |
Can we compile a program without main() function?
In C, What is the #line used for?
how do you programme Carrier Sense Multiple Access
What is the right type to use for boolean values in c? Is there a standard type?
What does != Mean in c?
What is abstract data structure in c?
what is the difference between getch() and getche()?
What is structure of c program?
How do you generate random numbers in C?
What is the use of getch ()?
Identify the correct argument for the function call fflush () in ANSI C: A)stdout B)stdin C)stderr D)All the above
Why the use of alloca() is discouraged?