From the title, the essence of the problem is clear. Interested in what is the temporal complexity of the algorithm of the AddRange () method of the list in C #?

    2 answers 2

    From the documentation :

    If List<T> can hold new elements without increasing Capacity , this method requires O(n) operations, where n is the number of added elements. If to accommodate new elements, it is necessary to increase the capacity, this method becomes O(n + m) operations, where n is the number of elements to add and m is the Count .

      If, when added to the list, its capacity does not need to be increased, then O (n)

      Otherwise, O (n + m) , where n is the number of added elements and m the length of the list before adding

      MSDN