• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reversing the LinkedList  RSS feed

 
Mahesh Vakare
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have one querry, how we can write code or fuction for single Linked list reversal without using Collection.reverse()?
if you provided with an object of linked list..
e.g
head --> 5 --> 10 --> 3 -->18 --> 2
and required o/p should be
head --> 2 --> 18 --> 3 --> 10 -->5

pls help me out...
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16059
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think about the problem and try to write some code yourself. It isn't really difficult. If you get stuck, post your code here and tell us exactly what you don't understand.

You'll learn more if you try it yourself than by letting others do all the work for you.

Please do your own homework.
[ August 17, 2007: Message edited by: Jesper Young ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!