Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Display data from a linkedList with recursion

843789Aug 25 2009 — edited Aug 26 2009
I am working on a project and I am stuck when it comes to the recursion part. I was wondering if someone could post a simple example that would help me. What I am trying to do is use the LinkedList class to store some Data. Lets say I have A, B, C, D stored in my linked list. So I want to use recursion to print all the items in the list.
A
B
C
D

or

A
C
B
D

I already have the linked list set up and the user can add as many items to it as they want, all that works, just the recursion part is killing me. When I search online I get a bunch of examples how to calculate power and stuff like that, I can't really find a example close to what I am trying to do. Can someone post some pseudocode or even a real code example to get me started on how to accomplish this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 23 2009
Added on Aug 25 2009
15 comments
246 views