aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes difference between sorting and ordering Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "difference between sorting and ordering" Watch "difference between sorting and ordering" New topic
Author

difference between sorting and ordering

vijay umar
Ranch Hand

Joined: Mar 24, 2009
Posts: 100
het every one!

i have a small confusion related to the difference between sorting and ordering?

i think ordering and sorting means the same? isnt it?

if you see ordering it means that the array is in a particular order wether it is like large to small or somthing like that!

and if you take sorting it also means almost same that you sort the array in an ascending or descending order?

i am right ? please intimate where i went wrong?
avi sinha
Ranch Hand

Joined: Mar 15, 2009
Posts: 453

ordering : it means there is a proper way you can predict the transversal of the content of a data holder like fifo or lifo
Sorting : it is a type of ordering which adheres some special ordering algorithm apart from the insertion order. like ascending or descending

the key part is that ordering doesn't depend upon the property of the element inserted but sorting does.

for ex in ascending ith element <i+1th element


SCJP 5.0 SCWCD 5.0
vijay umar
Ranch Hand

Joined: Mar 24, 2009
Posts: 100
thanks !

i am now clear about it!
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9305
    
  17

Since sorting is a type of ordering, so when a collection is sorted, it is automatically ordered. You might face a question asking if a sorted collection is automatically ordered (which is true) or if an ordered collection is automatically sorted (which is false)...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
 
subject: difference between sorting and ordering