Is a C # list like a C ++ list?

I'm just wondering if a C # list is like a C ++ list.

Deleting an item in the middle of a large list in C ++ is quick because I know that the elements just point to the following.

So, when deleting an item in the middle of a large C # list, is it the same as in C ++? Or a C # list is more like a C ++ vector with indexes, because you can get the index number of elements in a C # list.

+4
source share
1 answer
  • C # List<T> similar and has the same performance characteristics as C ++ vector<T> .
  • C # LinkedList<T> is analogous and has the same performance characteristics as C ++ List<T> .

Performance characteristics are discussed in detail in the comment sections of the relevant sections of the .net documentation: List<T> , LinkedList<T> .

+19
source

Source: https://habr.com/ru/post/1485325/


All Articles