| 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: 452
|
|
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
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9189
|
|
|
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
|
|
|