• Post Reply Bookmark Topic Watch Topic
  • New Topic

Quick Sort in Java  RSS feed

 
rahul khanna
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there an API in java which supports sortin such as bubble sort, quick sort?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the elements to be sorted are in an array or a List object, then you can use the "sort" methods of java.util.Arrays and java.util.Collections, respectively. These implement MergeSort (for List) and QuickSort (for arrays).

If you're looking for example code for the various sort algorithms, then Google knows about lots of those.
[ March 07, 2007: Message edited by: Ulf Dittmer ]
 
rahul khanna
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks .. a lot
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!