View Single Post
jedishrfu
jedishrfu is offline
#4
Feb21-12, 04:21 PM
P: 2,473

Linked list sorting method in java


on each loop thru looking for the largest don't you have to reset the largest back to Integer.MIN_VALUE?

it looks like your solution only makes one pass thru the list to find the largest. also your original head value is getting changed with head=head.link assignment so on your next pass you won't know where to begin.