C ++ Vector as a class in C #

What is a similar C ++ std::vector in C #?

I need a class in which it stores an internal array inside and supports back-panel insertion in O(1) .

+6
source share
2 answers

Here is a list with some C++ / C# containers that are roughly equivalent (not exact replacements) to each other:

+16
source
  • std :: list โ†’ LinkedList?
  • std :: vector โ†’ List?

std :: list is supported by an array, each deletion will have a copy of memory, the same behavior as a C # list. while C # LinkedList is supported by a node list, the same as std :: vector.

therefore I believe below correctly.

  • std :: list โ†’ List
  • std :: vector โ†’ LinkedList
-1
source

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


All Articles