• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between sorting and ordering

 
vijay umar
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
vijay umar
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks !

i am now clear about it!
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic