About Sorted list In VB.NET...

A sorted list is a collection class that  holds a set of key-values pairs.

Namespace:System.Collection

Implementing Interface:ICollection,IDicyionary

 

Characteristics:

  1. A sorted list may not contain duplicate keys.A hash table can have duplicate keys.
  2. Search is fast.
  3. Medium memory usage.
  4. Type of access isusing the index and key value.

Eg....

 

Module moduleSortedList

      sub main()

             dim st as SortedList

             st.add("a","1")

             st,add("c","3")

             st,add("b","2")

             Dim en As IDictionaryEnumerator=st.GetEnumerator

             While en.MoveNext

                    Console.WriteLine(en.Key+"--"+en.Value)

             End while

             Console.ReadLine()

             ''''''''st.GetKey(0)    Get Key By Index

             ''''''''st.ContainsKey(Key)     It Returns True,If It Contains Key

             ''''''''st.Count

             ''''''''st.Remove()

             ''''''''st.RemoneAt()

             ''''''''st.Item(Key)      Returns Object

             ''''''''st.ContainsValue(value)      It Returns True, If It Contains Value

       End Sub

End Module


Average Rating (0)
by Karan   Pande  in VB.Net  on 4/1/2015 2:06:14 AM  


Post Your Comment
*