AmitDiwan has Published 10740 Articles

Get an enumerator that iterates through the SortedList in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 06:34:48

476 Views

To get an enumerator that iterates through the SortedList, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(String[] args){       SortedList sortedList = new SortedList();       sortedList.Add("A", "1");       sortedList.Add("B", "2");       ... Read More

Creating a HybridDictionary with specified initial size in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 06:29:24

120 Views

To create a HybridDictionary with specified initial size, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main(){       HybridDictionary dict = new HybridDictionary(5);       dict.Add("A", "AB");       dict.Add("B", "BC");       ... Read More

Creating a Case-Sensitive HybridDictionary with specified initial size in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 06:25:29

136 Views

To create a case-sensitive HybridDictionary with specified initial size, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main(){       HybridDictionary myDict = new HybridDictionary(5, false);       myDict.Add("A", "AB");       myDict.Add("B", "BC");   ... Read More

Create HashSet from another collection in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 06:22:40

200 Views

To create HashSet from another Collection, the code is as follows−Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       HashSet set1 = new HashSet();       set1.Add(100);       set1.Add(200);       set1.Add(300);       Console.WriteLine("HashSet created from ... Read More

Create a Stack from a collection in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 06:18:09

147 Views

To create a Stack from a collection, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       Stack stack = new Stack();       stack.Push(100);       stack.Push(200);       stack.Push(300);       stack.Push(400); ... Read More

Check if two LinkedList objects are equal in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 06:12:55

158 Views

To check if two LinkedList objects are equal, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(String[] args){       LinkedList list1 = new LinkedList();       list1.AddLast("One");       list1.AddLast("Two");       list1.AddLast("Three");     ... Read More

Remove all elements of a List that match the conditions defined by the predicate in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 06:06:21

978 Views

To remove all elements from a list that match the conditions defined by the predicate, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    private static bool demo(int i){       return (i == 500);    }    public static void Main(String[] args){ ... Read More

Check if a SortedSet is a superset of the specified collection in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 06:02:08

138 Views

To check if a SortedSet is a superset of the specified collection, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       SortedSet set1 = new SortedSet();       set1.Add("CD");       set1.Add("CD");       ... Read More

Check if a HashSet is a superset of the specified collection in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 05:58:33

148 Views

To check if a HashSet is a superset of the specified collection, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       HashSet set1 = new HashSet();       set1.Add("AB");       set1.Add("CD");       ... Read More

Check if two HybridDictionary objects are equal in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 05:54:01

193 Views

To check if two HybridDictionary objects are equal, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main(){       HybridDictionary dict1 = new HybridDictionary();       dict1.Add("A", "Books");       dict1.Add("B", "Electronics");       ... Read More

Advertisements