the <code>sortedlist<tkey, tvalue></code> generic class is a binary search tree with o(log n) retrieval, where n is the number of elements in the dictionary. in this, it is similar to the <code>sorteddictionary<tkey, tvalue></code> generic class. the two classes have similar object models, and both have o(log n) retrieval. where the two classes differ is in memory use and speed of insertion and removal: <code>1.sortedlist<tkey, tvalue></code> uses less memory than <code>sorteddictionary<tkey, tvalue></code>. <code>2.sorteddictionary<tkey, tvalue></code> has faster insertion and removal operations for unsorted data, o(log n) as opposed to o(n) for <code>sortedlist<tkey, tvalue></code>. 3.if the list is populated all at once from sorted data, <code>sortedlist<tkey, tvalue></code> is faster than <code>sorteddictionary<tkey, tvalue></code>.
歡迎轉載,轉載請注明: