Theoretical CS

2.2 Associative Structures

You’ve also probably encountered associative structures before; in Python, a dictionary is a great example! An associative structure can be thought of as a way to group different data together.


A tuple is an immutable data structure that is similar to a Python list with fixed length. They are often referred to as n-tuples, where n is the number of elements that tuple contains.


A map is a mutable data structure; you can think of a map as a list of pairs (2-tuples). Maps can also be thought of as a function in the mathematical sense – a map maps a domain to a range.

<< 2.1 Linear Structures 2.3 Lab 2 >>