Reputation: 2107
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.
Upvotes: 9
Views: 14552
Reputation: 181
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.
Upvotes: -3
Reputation: 5866
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)
Upvotes: 32