The moose likes Beginning Java and the fly likes bubble sort algorithm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "bubble sort algorithm" Watch "bubble sort algorithm" New topic

bubble sort algorithm

tyler jones
Ranch Hand

Joined: Dec 01, 2000
Posts: 101
I'm reading a book and it has an exercise at the end of a chapter that says to use the bubble sort algorithm. I've checked out sun's website and can't find any mention of it, and the book doesn't mention anymore about it. Does anyone know if this is a built in method in java? And if so, what class is it in? Thanks.
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
This is a standard algorithm for programming regardless of the language, C, C++, Pascal, Java, etc. As far as I know, there is no method in the java API called bubble sort. Check your local library for a book on algorithms to get the general concept. A good one is Data Structures & Algorighms in Java by Mitchell Waite.

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Here is a site that contains some sort algorithms:
I agree. Here's the link:
subject: bubble sort algorithm
It's not a secret anymore!