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 |
write the program for maximum of the following numbers? 122,198,290,71,143,325,98
c program to input values in a table(using 2D array) and print odd numbers from them
consagous technology placement paper
What is an arrays?
Program to write some contents into a file using file operations with proper error messages.
What do you mean by dynamic memory allocation in c? What functions are used?
define c
Write a program to add the following ¼+2/4+3/4+5/3+6/3+... (Like up to any 12 no.s)
Write a code to reverse string seperated by spaces i/p str=India is my country o/p str=aidnI si ym yrtnuoc After writing code, optimize the code
write a program to count the no of repaeted words in a line?
what are the advantage of pointer variables? write a program to count the number of vowels and consonants in a given string
What is a rvalue?