Hi All,
Can any body let me know if data in a hash table folows any order ie., asc or desc or it simply just follows the concept of LIFO.
thanks
Tapsya
Hi All,
Can any body let me know if data in a hash table folows any order ie., asc or desc or it simply just follows the concept of LIFO.
thanks
Tapsya
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SumitPosted May 30, 2008, 3:54 AM
Hashtables are unsorted collections and do not implement any sorting functionality. An alternative to get sorted list is to put the hashtable values into a collection that imlements sorting. We can use System.Collections.SortedList as well as ArrayList to get sorted values.
ArrayList al = new ArrayList (hashtable.Values);
al.Sort (myNameComparator);
System.Collections.
SortedList sl = new System.Collections.SortedList(h.Values);