What is the analogous class of C++ std::vector
in C#?
I want a class where it keeps an internal array inside and supports insertion at the back in O(1)
time.
Here is a list with some C++
/ C#
containers that are roughly equivalent (not exact replacements) to each other:
std::multiset
-> SortedDictionary<Tkey, int>
( int
keeping count of the number of Tkey
s)
std::list is backed by array, each deletion would incur memory copy, same behavior as C# List. while C# LinkedList is backed by node list, same as std::vector.
so I believe below is correct.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.