Comparison of C STL collections and C collections

0 votes

I'm still learning C#, and I was startled to see that a List<T> behaves much like a std::vector rather than a std::list. Can someone please describe all of the C# collections in terms of the STL (or, if that's too complex, standard conceptual data types with Wikipedia links)? I believe the reference will be of great use to many people.

A short list of collections of interest (feel free to add more) is as follows:

  1. Array
  2. List
  3. ArrayList
  4. HashTable
  5. Dictionary
  6. ListDictionary
  7. SortedDictionary
  8. SortedList
  9. Queue
  10. Stack
Jun 9 in C# by pranav
• 2,580 points
26 views

1 answer to this question.

0 votes

This is what I know

  1. Array - C array, though the .NET Array can have a non-zero starting index.
  2. List<T> - std::vector<T>
  3. Dictionary<TKey, TValue> - unordered_map<Key, Data>
  4. HashSet<T> - unordered_set<Key>
  5. SortedDictionary<TKey, TValue> - std::map<Key, Data>
  6. SortedList<TKey, TValue> - equivalent to a std::vector<T> but keeping it ordered by using binary search + insert when adding elements.
  7. SortedSet<T> - std::set<Key>
  8. Queue<T> - std::queue<T>
  9. Stack<T> - std::stack<T>
  10. LinkedList<T> - std::list<T>
answered Jun 9 by rajiv
• 1,620 points

Related Questions In C#

0 votes
1 answer

What is the difference between C# and .NET?

C# is a programming language, and.NET refers ...READ MORE

answered Jun 7 in C# by pranav
• 2,580 points
21 views
0 votes
1 answer

Which version of C# am I using

From developer cmd, type this csc -langversion:? This will ...READ MORE

answered Jun 7 in C# by pranav
• 2,580 points
19 views
0 votes
1 answer

Examples of dynamic polymorphism in c#

Check the example of polymorphism below. We ...READ MORE

answered Jun 7 in C# by pranav
• 2,580 points
30 views
0 votes
1 answer

Origin of the C# language name

The '#' is actually a musical sharp ...READ MORE

answered Jun 7 in C# by pranav
• 2,580 points
19 views
0 votes
1 answer

Syntax of priority queue

We must first include the queue header file in order to establish a priority queue in C++. #include <queue> Once we import this file, we ...READ MORE

answered May 31 in C++ by Damon
• 4,760 points
13 views
0 votes
1 answer

Sorting a vector of custom objects

A simple example using std::sort struct MyStruct { ...READ MORE

answered Jun 1 in C++ by Damon
• 4,760 points
36 views
0 votes
1 answer

C# books or web sites for C++

I would recommend checking out C# in ...READ MORE

answered Jun 6 in C# by pranav
• 2,580 points
21 views
0 votes
1 answer

lower_bound == upper_bound

Lower bound: the initial greater-or-equal element. Upper bound: ...READ MORE

answered Jun 21 in C++ by Damon
• 4,760 points
39 views
0 votes
1 answer

What are the differences between C, C# and C++ in terms of real-world applications?

C is a bare-bones, straightforward, and clean ...READ MORE

answered May 30 in C# by rajiv
• 1,620 points
28 views
0 votes
1 answer

C# - Can someone please show me a very simple example of Interfaces

Take this as example interface IFlyable { ...READ MORE

answered May 30 in C# by rajiv
• 1,620 points
23 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP