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.
Sumit2 pointsPosted May 29, 2008, 11:54 PM EDT
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);