1/16
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Collections
there is a group of objects that provides a standard set of types for storing and managing collections of object.
2 types of collections
Standard Collections
Generic Collections
Standard Collections
these are found in the System.Collections namespace.
Generic Collections
there is a group of objects that provides a standard set of types for storing and managing collections of object.
ArrayList
this is a collection class that is known for an ordered collection of object.
it is known as a dynamic since items can be added and removed from the specified index location.
HashTable
this class stores key or value pairs where the key represents the value in the collection.
when accessing values in this class, the key must be specified.
SortedList
this class is a combination or ArrayLis and HashTable.
it stores key or value pairs where the key values sort values.
Stack
this represents a Last In, First Out (LIFO) collection of objects.
pop - insert
push - removing
Queue
this class represents a First In, First Out (FIFO) collection of objects.
enqueue - adding
dequeue - removing
IEnumerable
it is an interface that allows you to loop through elements in a collection.
ICollection
it is an interface that allows you to determine the number of elements in a collections and copy them in a simple array type.
IDictionary
it is an interface that provides a list of elements that are accessible via a key or value rather than an index.
Generics
allows specifying the data types of the programming elements when they are actually used in the program.
when using this, it allows creating collections like linkedlists, hashtables, stacks, and queue that operates on an item of any data type.L
List <T>
a generic collection that provides an efficient and dynamically allocated array, which is commonly used to store a list of duplicate objects.
can grow and shrink with the number of objects.
List<T> variableName = new List<T>();
Queue<T>
a generic collection that represents (FIFO) collection objects.
Queue<T> ageQueue = new Queue<int>();
Stack<T>
a generic collection represent (LIFO) collection of instances.
Stack<int> ageStack = new Stack<int>(20);