Advanced Collections in C#
Advanced Collections in C#: HashSet, Queues, Stacks.
Updated
- HashSet (Journeyman): A HashSet<T> holds each value once, answers "is it in here?" fast, and has no index or guaranteed order. Add tells you whether a value was new.
- Queues (Journeyman): A Queue<T> hands values back in the order they arrived, first in, first out. Enqueue adds to the back of the line, Dequeue takes from the front, and Peek looks without taking.
- Stacks (Journeyman): A Stack<T> hands values back newest first, last in, first out. Push adds to the top, Pop takes from the top, and Peek looks without taking. Undo is the classic use.