Operation set and string

xiaoxiao2021-04-09  315

Understand the ARRAYLIST, HashTable, SortedList, and strings have a certain understanding of how to access a collection includes inserting a single and multiple, deleting a single and multiple data, sorting and more: "ASP.NET Secret (No. 1 Version)"

For example: three ways to havehtable, I list two

DictionaryTry Objitem

Foreach (Objitem in colhashtable)

Response.write ("

  • " Objitem.Key "=" Objitem.Value);

    // HashTabel Each Item is an instance of a DictionaryEntry class

    String strient

    Foreach (stritem in colhashtable.keys)

    Response.write ("

  • " stritem);

    In terms of search, ArrayList's search time is O (N), and binarysearch () is O (log2n), but the latter needs to be sorted with sort () before search.

    Insert, delete operations will not be summarized, you can check the MSDN, understand it quickly. :)

    However, add data in these collections can be any type, including a class

  • 转载请注明原文地址:https://www.9cbs.com/read-133059.html

    New Post(0)