This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes swap... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "swap..." Watch "swap..." New topic
Author

swap...

Larry Lai
Ranch Hand

Joined: May 13, 2002
Posts: 44
Hi everyone,

I'm not sure what swap it is...
Here is an example code:


If anyone knows, tell me what it's going on...or give one more example for me learning...

Thanks a lot
Larry
David Weitzman
Ranch Hand

Joined: Jul 27, 2001
Posts: 1365
If I'm not mistaken, you seem to have some code from an implementation of QuickSort. Swap would look something like this:

The split() method is dividing the array into two partitions. The elements in one partition are all greater than the elements in the other partition. The return value of split() is the location where the partitions meet.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: swap...