© Elshad Karimov 2020
E. KarimovData Structures and Algorithms in Swifthttps://doi.org/10.1007/978-1-4842-5769-2_2

2. Dictionaries

Elshad Karimov1 
(1)
New York, New York, USA
 

In this chapter, the dictionary type of data structures will be discussed. You will learn how to access, add, remove, and modify elements in a dictionary. Moreover, built-in properties and functions of dictionaries will be covered.

Introduction

A dictionary is another data type collection in Swift. This data structure takes its name from real-world dictionaries where you have words and their associated meaning; in programming, we use dictionaries to associate a key with its value, so any value can be identified as long as we know the key. If we look inside a real dictionary, we ...

Get Data Structures and Algorithms in Swift: Implement Stacks, Queues, Dictionaries, and Lists in Your Apps 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.