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, 2022 in C# by pranav
• 2,590 points
656 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, 2022 by rajiv
• 1,620 points

Related Questions In C#

0 votes
0 answers

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

As the title states, what are the ...READ MORE

Sep 26, 2022 in C# by krishna
• 2,820 points
311 views
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, 2022 in C# by pranav
• 2,590 points
699 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, 2022 in C# by pranav
• 2,590 points
505 views
0 votes
1 answer

Examples of dynamic polymorphism in c#

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

answered Jun 7, 2022 in C# by pranav
• 2,590 points
873 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, 2022 in C++ by Damon
• 4,960 points
634 views
0 votes
1 answer

Sorting a vector of custom objects

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

answered Jun 1, 2022 in C++ by Damon
• 4,960 points
1,283 views
0 votes
1 answer

C# books or web sites for C++

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

answered Jun 6, 2022 in C# by pranav
• 2,590 points
518 views
0 votes
1 answer

lower_bound == upper_bound

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

answered Jun 21, 2022 in C++ by Damon
• 4,960 points
1,066 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, 2022 in C# by rajiv
• 1,620 points
727 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, 2022 in C# by rajiv
• 1,620 points
462 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP