create an SINGLE LINKED LISTS and reverse the data in the
lists completely

Answers were Sorted based on User's Feedback



create an SINGLE LINKED LISTS and reverse the data in the lists completely..

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

create an SINGLE LINKED LISTS and reverse the data in the lists completely..

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

create an SINGLE LINKED LISTS and reverse the data in the lists completely..

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

Post New Answer

More C Interview Questions

WHAT IS ABSTRACT DATA TYPE

4 Answers   Wipro,


Why doesn't C have nested functions?

2 Answers  


Why is this loop always executing once?

0 Answers  


Explain heap and queue.

0 Answers   Aricent,


Why we use break in c?

0 Answers  






how to find anagram without using string functions using only loops in c programming

1 Answers   Mind Tree, TCS,


What is the importance of c in your views?

0 Answers  


how do you redirect stdout value from a program to a file?

1 Answers  


Which built-in library function can be used to match a patter from the string?

0 Answers  


What are types of preprocessor in c?

0 Answers  


What are the types of variables in c?

0 Answers  


how to swap two integers 1 and 32767 without using third variable

11 Answers   Microsoft, TCS,


Categories