CSharp Interview Questions

State different generic collections defined in System.Collections.Generic Namespace ?

Different generic collections defined in System.Collections.Generic Namespace are listed below :

  1. List<T> – Represents a strongly typed list of objects that can be accessed by index.
  2. Dictionary<TKey, TValue> – Represents a collection of keys and values
  3. HashSet< T> – Represents a set of values.
  4. LinkedList< T> – Represents a doubly linked list.
  5. Queue<T> – Represents a first-in, first-out collection of objects.
  6. Stack<T> – Represents a variable size last-in-first-out (LIFO) collection of instances of the same arbitrary type.
  7. SortedDictionary<TKey, TValue> – Represents a collection of key/value pairs that are sorted on the key
  8. SortedList<TKey, TValue>Represents a collection of key/value pairs that are sorted by key
  9. SortedSet<T> – Represents a collection of objects that is maintained in sorted order.

Leave a Reply