Javatpoint.com is changed to TpointTech.com
C# Dictionary<TKey, TValue>C# Dictionary<TKey, TValue> class uses the concept of hashtable. It stores values on the basis of key. It contains unique keys only. By the help of key, we can easily search or remove elements. It is found in System.Collections.Generic namespace. C# Dictionary<TKey, TValue> exampleLet's see an example of generic Dictionary<TKey, TValue> class that stores elements using Add() method and iterates elements using for-each loop. Here, we are using KeyValuePair class to get key and value. Output: 1 Sonoo 2 Peter 3 James 4 Ratan 5 Irfan Next TopicC# SortedDictionary<TKey,TValue> |
Javatpoint.com is now changed to TpointTech.com, so we request you to subscribe our newsletter for further updates.
C# HashSet<T> C# HashSet class can be used to store, remove or view elements. It does not store duplicate elements. It is suggested to use HashSet class if you have to store only unique elements. It is found in System.Collections.Generic namespace. C# HashSet<T> example Let's see an example of...
2 min read
C# SortedList<TKey, TValue> C# SortedList<TKey, TValue> is an array of key/value pairs. It stores values on the basis of key. The SortedList<TKey, TValue> class contains unique keys and maintains ascending order on the basis of key. By the help of key, we can easily search or remove...
2 min read
C# LinkedList<T> C# LinkedList<T> class uses the concept of linked list. It allows us to insert and delete elements fastly. It can have duplicate elements. It is found in System.Collections.Generic namespace. It allows us to add and remove element at before or last index. C# LinkedList<T> example Let's see an...
2 min read
C# List<T> C# List<T> class is used to store and fetch elements. It can have duplicate elements. It is found in System.Collections.Generic namespace. C# List<T> example Let's see an example of generic List<T> class that stores elements using Add() method and iterates the list using for-each loop. using System; using System.Collections.Generic; public...
2 min read
C# SortedDictionary<TKey, TValue> C# SortedDictionary<TKey, TValue> class uses the concept of hashtable. It stores values on the basis of key. It contains unique keys and maintains ascending order on the basis of key. By the help of key, we can easily search or remove elements. It is...
1 min read
In C#, collection represents group of objects. By the help of collections, we can perform various operations on objects such as store object update object delete object retrieve object search object, and sort object In sort, all the data structure work can be performed by C# collections. We can store objects in array or...
1 min read
C# SortedSet<T> C# SortedSet class can be used to store, remove or view elements. It maintains ascending order and does not store duplicate elements. It is suggested to use SortedSet class if you have to store unique elements and maintain ascending order. It is found in System.Collections.Generic...
2 min read
C# Stack<T> C# Stack<T> class is used to push and pop elements. It uses the concept of Stack that arranges elements in LIFO (Last In First Out) order. It can have duplicate elements. It is found in System.Collections.Generic namespace. C# Stack<T> example Let's see an example of generic Stack<T>...
1 min read
C# Queue<T> C# Queue<T> class is used to Enqueue and Dequeue elements. It uses the concept of Queue that arranges elements in FIFO (First In First Out) order. It can have duplicate elements. It is found in System.Collections.Generic namespace. C# Queue<T> example Let's see an example of generic Queue<T>...
1 min read
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India