Mid From PDF Collections C# Collections

How does the HashSet<T> differ from a List<T> or Dictionary<TKey, TValue>?

Feature HashSet<T> List<T> Dictionary<TKey,

TValue>

llows

duplicates?

No Yes Keys: No; Values: Yes

Order No guaranteed

order

Maintains insertion

order

No guaranteed order

Lookup speed O(1) average O(n) O(1) average for keys

Key-value pairs No (only values) No Yes (key-value pairs)

More from C# Programming Tutorial

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details