Chapter 2. Understanding Collections: Associative Arrays

After completing this chapter, you will be able to

  • Identify associative arrays.

  • Design and implement associative arrays.

  • Understand when and when not to use associative arrays.

Associative Array Overview

An associative array, also called a dictionary, is an abstract collection type that associates a single key with a value. Each key in the collection is unique. Some languages refer to an associative array as a hash table, which generally leads to some confusion regarding the difference between an associative array and a hash table. An associative array defines how a collection should behave, such as associating a key with a value. You can implement an associative array in many ways. One possible ...

Get Developer’s Guide to Collections in Microsoft® .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.