Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
R Data Structures and Algorithms

You're reading from   R Data Structures and Algorithms Increase speed and performance of your applications with effi cient data structures and algorithms

Arrow left icon
Product type Paperback
Published in Nov 2016
Publisher Packt
ISBN-13 9781786465153
Length 276 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Achyutuni Sri Krishna Rao Achyutuni Sri Krishna Rao
Author Profile Icon Achyutuni Sri Krishna Rao
Achyutuni Sri Krishna Rao
PKS Prakash PKS Prakash
Author Profile Icon PKS Prakash
PKS Prakash
Arrow right icon
View More author details
Toc

Dictionaries


A dictionary can be defined as an ordered or unordered list of key-element pairs, where keys (usually unique) are used to locate elements (not necessary unique) in the data structure. For example, a data structure that stores customer information in a retail shop can be considered as a dictionary, where the consumer ID serves as the key for identification of different customers. Dictionaries are also known as associative arrays or maps, as they map keys to values to perform retrieval operations such as addition, removal, and search. Every element of a dictionary consists of a key and an associated element, also known as a key-value pair. This is shown in Figure 4.11:

Figure 4.11: Dictionary key-value pair structure

The key in a dictionary is used to differentiate between each key-value pair. It can be any randomly chosen set of values, such as real numbers or strings, with the only restriction that each key is unique, and can be differentiated from the others. The values in...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image