11Special Collections
OVERVIEW
Chapter 10, “Collections,” covers lists, queues, stacks, dictionaries, and linked lists. This chapter continues with special collections, such as collections for dealing with bits, collections that can be observed when changed, collections that cannot be changed, and collections that can be accessed from multiple threads simultaneously.
WORKING WITH BITS
If you need to deal with a number of bits, C# 7 has extensions like the binary literal and the number separator that are covered in Chapter 2, “Core C#,” and Chapter 6, “Operators and Casts.” When you work with binary data, you can also use the class BitArray and the struct BitVector32. BitArray is located in the namespace System.Collections, and BitVector32 is in the namespace System.Collections.Specialized. The most important difference between these two types is that BitArray is resizable—which ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access