O'Reilly logo

Developer’s Guide to Collections in Microsoft® .NET by Calvin “Lee” Janes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Generic and Support Collections

After completing this chapter, you will be able to

  • Use the Queue(T) class.

  • Use the Stack(T) class.

  • Use the Dictionary(TKey, TValue) class.

  • Use the BitArray class.

  • Use the CollectionBase and DictionaryBase classes.

  • Use the HashSet(T) class.

  • Use SortedList(TKey,TValue) and SortedDictionary(TKey,TValue) classes.

Queue(T) Overview

The Queue(T) class is a generic implementation of a First In, First Out (FIFO) collection or queue, as discussed in Chapter 3.

The Queue(T) class uses an array for data storage in the same way that the QueuedArray(T) class does in Chapter 3

Pushing items onto a queue that has full capacity takes O(n) operations; otherwise it takes only O(1) operations. Popping an item from the queue always ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required