Home arrow static arrow Java Programming [Archive] - Reversing LinkedList elements
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Reversing LinkedList elements
This topic has 142 replies on 10 pages.    « Previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Next »

Posts:37,103
Registered: 3/30/99
Re: Reversing LinkedList elements  
Aug 8, 2004 11:26 AM (reply 45 of 142)



 
i dont' care much about the nick or rep in this fora,

Yes, it's been abundantly clear for quite some time now that you don't care about your reputation. Why bother acting like a decent human being or treating people with respect when we can't see you anyway. Based on your threats of physical violence under the Robo nick, you probably figure that since we're not in a position to beat the holy living **** out of you, why not just treat people here as your servants and use them to give you answers to things you could figure out on oyur own if you were willing to work a little.
 

Posts:37,103
Registered: 3/30/99
Re: Reversing LinkedList elements  
Aug 8, 2004 11:27 AM (reply 46 of 142)



 
My answer had suffient information, including when
to
stop and consider.

could your please cosider making life easier atleast
at this stage?


Why? Why the **** should anybody help you at all, *****?
 

Posts:37,103
Registered: 3/30/99
Re: Reversing LinkedList elements  
Aug 8, 2004 11:30 AM (reply 47 of 142)



 
great way to learn. If you doesn't have a debugger,
just add a lot of System.out to the code, and run it.

He's been advised to do this many times already. He'll only do it as a last resort. It's too much like work. He'd rather just have somebody else spoon feed him the answer.
 

Posts:37,103
Registered: 3/30/99
Re: Reversing LinkedList elements  
Aug 8, 2004 11:32 AM (reply 48 of 142)



 
can you tell me whats the
".next"
for?
is .next a field?

If you're studying for an exam and you don't even know why a linked list has a .next, then the correct course of action for you is to fail the course.
 

Posts:37,103
Registered: 3/30/99
Re: Reversing LinkedList elements  
Aug 8, 2004 11:34 AM (reply 49 of 142)



 
Well Mr. A, it's been fun.
Good luck with your notional exam.

You are like an irritant You need to be diminished


Are you really that ******* clueless? You think comments like that are going to improve your chances of getting help here in the future, Mr. "I don't care about my reputation because I'm too ******* cool to reat others with respect"?
 

Posts:357
Registered: 8/5/04
Re: Reversing LinkedList elements  
Aug 8, 2004 11:36 AM (reply 50 of 142)



 
cheer up, even today u woke up from wrong side of the bed?

i really don't like to offend you man
let's all be happy

anyways is the last thing i said true? that as loop goes on it just changes the next node to previous and previous to next?

 

Posts:37,103
Registered: 3/30/99
Re: Reversing LinkedList elements  
Aug 8, 2004 11:40 AM (reply 51 of 142)



 
i really don't like to offend you man

Well, you do, and I think I've made it clear why I find you offensive.
 

Posts:357
Registered: 8/5/04
Re: Reversing LinkedList elements  
Aug 8, 2004 11:42 AM (reply 52 of 142)



 
Hey jverd, sorry man please don't be upset.
I'll try to do what you're saying.

As I am a bit novice I don't know how much importance you regulars give to fora.
 

Posts:357
Registered: 8/5/04
Re: Reversing LinkedList elements  
Aug 8, 2004 11:51 AM (reply 53 of 142)



 
Hi can anyone tell me why do I get "OutOfMemory" exception if I comment out

 first.next = null 
below?

Is it that it will go on calling first.next even if it reaches null?

[code]
Link previous = first;
Link current = first.next;

first.next = null;

while(current != null) {
System.out.println("previous = " + previous + " current = "
+ current);

Link next = current.next;

current.next = previous; //last will be FIRST
previous = current;//First will be LAST

current = next; //for terminating LOOP
}

first = previous;
}

 

Posts:357
Registered: 8/5/04
Re: Reversing LinkedList elements  
Aug 8, 2004 11:56 AM (reply 54 of 142)



 
OK - I would like to get this question answered

When reverse method is not called its Doubly linked list but WHEN

reverse method IS called it becomes SINGLY linked list?

Thanks a lot !
 

Posts:37,103
Registered: 3/30/99
Re: Reversing LinkedList elements  
Aug 8, 2004 12:00 PM (reply 55 of 142)



 
Hey jverd, sorry man please don't be upset.
I'll try to do what you're saying.

As I am a bit novice I don't know how much importance
you regulars give to fora.

It's not the forums, it's general common courtesy and work ethic. The forums aren't just faceless software. There are people on the other end, and we have our own lives, our own concerns, our own deadlines. We help others here because we like to help, and because we also learn during the process, but we expect you to do your part.

If you've read what others and I have said about your posts, you'll understand why some of us are no longer interested in trying to help you.

If you're able to swallow your pride, admit your mistakes, and make an honest effort to put more thought into future posts, then you'll no doubt get lots of good help.
 

Posts:18,384
Registered: 21.03.00
Re: Reversing LinkedList elements  
Aug 8, 2004 12:01 PM (reply 56 of 142)



 
The code I posted was always single linked. Don't know if you original code is double, or single linked.

/Kaj
 

Posts:357
Registered: 8/5/04
Re: Reversing LinkedList elements  
Aug 8, 2004 12:04 PM (reply 57 of 142)



 
The code I posted was always single linked. Don't know
if you original code is double, or single linked.

hey Kaj whats the difference between singly and doubly linked list?

is it that doubly Linked.. needs to implement iterator in its class?
 

Posts:37,103
Registered: 3/30/99
Re: Reversing LinkedList elements  
Aug 8, 2004 12:05 PM (reply 58 of 142)



 
When reverse method is not called its Doubly linked
list but WHEN

reverse method IS called it becomes SINGLY linked
list?

Why do you think this is the case? Slow down, think about what you're saying...

Look, if you're trying to cram a whole term's worth of data structures education into the last few days before your exam, you're probably screwed. Trust me--been there, done that. I don't think most people here could care less about your exam. People here are happy to help others learn, but passing an exam != learning.
 

Posts:37,103
Registered: 3/30/99
Re: Reversing LinkedList elements  
Aug 8, 2004 12:07 PM (reply 59 of 142)



 
The code I posted was always single linked. Don't
know
if you original code is double, or single linked.

hey Kaj whats the difference between singly and doubly
linked list?

is it that doubly Linked.. needs to implement iterator
in its class?

Oh, jeez.

Did you attend even a single class? Come on man, think a little bit. What is a "linked list"? What does the word "linked" mean here? Now, think about the meanings of the words "single" and "double". Read what others have written in this thread about singly and doubly linked lists.
 
This topic has 142 replies on 10 pages.    « Previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Next »