Mind map
Linear Data Structures
Map content
Linear Data Structures
Lists
- ordered
- to access an element, use the name of the list, followed by the index of the element inside square brackets
- changeable
- add an element using .append()
- remove an element using .remove(), or, .pop() to remove the element at an index
- allow duplicates
- elements can have different data types
- denoted [...,...,...]
- ordered
Tuples
- ordered
- to access an element, use the name of the tuple, followed by the index of the element inside square brackets
- access the last element by putting -1 inside the brackets
- access a range of elements by using a colon
- to access an element, use the name of the tuple, followed by the index of the element inside square brackets
- unchangeable
- allow duplicates
- elements can have different data types
- denoted (...,...,...)
- must include a comma inside parentheses to specify a tuple
- ordered
Sets
- unordered
- loop through sets to see items
- can check to see if an element exists in a set
- changeable
- add an element using .add()
- merge 2 sets using .update()
- reject duplicates
- elements can have different data types
- denoted {...,...,...}
- unordered
Dictionaries
- denoted {key1:value1,...,...}
- stores data in key:value format
- powerful way to describe items
- add a new key value: dictionaryName["key"] = "value"
- unordered
- retrieve a value: dictionaryName["key"]
- denoted {key1:value1,...,...}
Information
- Description
- Mind Map on Linear Data Structures, created by Hadley Browder on 28/01/2021.
- Created by
- Hadley Browder
- Views
- 0
- Rating