Chapter 6: Arrays and Collections


In order to use a computer properly, we need to understand the structural relationships present within data, as well as the basic techniques for representing and manipulating such structure within a computer.
Donald E. Knuth, The Art of Computer Programming: Volume 1, Fundamental Algorithms

Overview

Lists of information are the simplest possible data structure associating multiple data elements together to form a special relationship. Storing and retrieving data in and from them are some of the most rudimentary and commonplace operations a modern software program must accomplish. The .NET Framework offers numerous data structures for this purpose, from arrays as a first-class citizen in the type system to powerful and extensible list classes, stacks and queues, dictionaries, and more. Many powerful APIs to perform activities like sorting and searching are also available. This chapter presents these types and their capabilities, and provides the knowledge needed to effectively choose between them based on your scenario.

In particular, this chapter is a tour of the more advanced array operations and the types in the System.Collections and System.Collections.Generic namespaces. You will find that the types in these namespaces have been carefully factored into clean class and interface hierarchies, making them powerful, extensible, and most importantly, intuitive to use. With the introduction of generics in the CLR 2.0, the System.Collections namespace will likely not be of great interest to you. We discuss it in this chapter for completeness but focus primarily on the new generic APIs. You'll recognize many similarities between the two.




Professional. NET Framework 2.0
Professional .NET Framework 2.0 (Programmer to Programmer)
ISBN: 0764571354
EAN: 2147483647
Year: N/A
Pages: 116
Authors: Joe Duffy

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net