|
-
Nov 17th, 2005, 10:17 PM
#1
Thread Starter
New Member
linked list to print starting from middle then right to left
this is my very first java program and i have an idea on how to do this but i don't have the concepts down.......i need to store a sequence in a linked list and print them on the screen starting from the middle and then from the left and then the right....example: 103 23 4 13 21 18 19= 13 4 23 103 21 18 19
if someone could just point me in the right direction i would GREATly appreciate it!!!
thanks!
-
Nov 18th, 2005, 07:15 AM
#2
Re: linked list to print starting from middle then right to left
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Nov 18th, 2005, 02:54 PM
#3
Thread Starter
New Member
Re: linked list to print starting from middle then right to left
-
Nov 18th, 2005, 09:24 PM
#4
Frenzied Member
Re: linked list to print starting from middle then right to left
Print out the middle.
Then a normal for loop to print from left to right.
A 'descending' for loop to print right to left.
-
Nov 19th, 2005, 03:18 AM
#5
Thread Starter
New Member
Re: linked list to print starting from middle then right to left
-
Nov 19th, 2005, 07:01 AM
#6
Re: linked list to print starting from middle then right to left
That's not a linked list program.
A linked list class is supposed to link to the next element (optionally the previous one)
each class object has a value
public class A{
private A next;
private int value;
.
.
.
}
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Nov 19th, 2005, 09:05 AM
#7
Frenzied Member
Re: linked list to print starting from middle then right to left
 Originally Posted by ComputerJy
That's not a linked list program.
A linked list class is supposed to link to the next element (optionally the previous one)
each class object has a value
public class A{
private A next;
private int value;
.
.
.
}
Your point? Loops/Iterators will work just fine if you know what you're doing.
-
Nov 19th, 2005, 09:22 AM
#8
Re: linked list to print starting from middle then right to left
 Originally Posted by rain4444
this is my very first java program and i have an idea on how to do this but i don't have the concepts down.......i need to store a sequence in a linked list  and print them on the screen starting from the middle and then from the left and then the right....example: 103 23 4 13 21 18 19= 13 4 23 103 21 18 19
if someone could just point me in the right direction i would GREATly appreciate it!!!
thanks!
My point is: Where the hell is the linked list representation?
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Nov 19th, 2005, 09:31 AM
#9
Frenzied Member
Re: linked list to print starting from middle then right to left
 Originally Posted by ComputerJy
My point is: Where the hell is the linked list representation?
Sorry, thought it was directed toward me, but you are right. He needs to show us his implementation.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|