my dog learned polymorphism
The moose likes Beginning Java and the fly likes Linked List Sorting Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic

Linked List Sorting Problem

Joel Cochran

Joined: Sep 28, 2007
Posts: 6
I'm trying to sort a list of integers using bubble sort, insertion sort and selection sort and so far it isn't going so hot. I've created my own LinkedList class (singly linked list) and am a little stuck. Here's everything I have so far...

Ignore the insertionSort method. The bubbleSort methods ALMOST works. For some reason it ignores about half the list and sorts the other half correctly. Any tips/advice on improving my existing code and help on the other sorting methods will be VERY much appreciated. Thanks!!
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32811

Please don't post the same question in multiple forums. This makes replies harder to follow.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Linked List Sorting Problem
It's not a secret anymore!