Mapa mental
Linear Data Structures
Contenido del mapa
Linear Data Structures
Lists
- Ordered
- Changeable
- Allow duplicates
- Allow many data types (strings, integers, T/F)
- Allow duplicates
- Changeable
- Syntax [...,...,...]
- Add to list using listTitle.append
- Remove first element in list using listTitle.remove
- Remove specific element in list using listTitle.pop(index) ***index starts at 0***
- Access element in list using list.Title[]
- Remove specific element in list using listTitle.pop(index) ***index starts at 0***
- Remove first element in list using listTitle.remove
- Add to list using listTitle.append
- Ordered
Tuples
- Syntax (...,...,...)
- Must include comma after each element even if there is only one element
- Access element using tupleTitle[]
- tupleTitle[-1] returns last item
- tupleTitle[x:y] gives elements from index x to index y
- tupleTitle[-1] returns last item
- Access element using tupleTitle[]
- Must include comma after each element even if there is only one element
- Ordered
- Unchangeable
- Allow duplicates
- Allow many data types (strings, integers, T/F)
- Allow duplicates
- Unchangeable
- Syntax (...,...,...)
Sets
- Syntax {...,...,...}
- Use for loop instead of indices to access items in set
- Check if element exists in set T/F print("x" in setTitle
- Add elements to set using setTitle.add()
- Merge two sets using setTitle.update()
- Add elements to set using setTitle.add()
- Check if element exists in set T/F print("x" in setTitle
- Use for loop instead of indices to access items in set
- Unordered
- Unchangeable
- No duplicates
- Allow many data types (strings, integers, T/F)
- No duplicates
- Unchangeable
- Syntax {...,...,...}
Dictionaries
- Syntax (key1:value1,...)
- To update value: dictionaryTitle["key"]="value"
- Add new key to dictionary: newKey=dictionaryTitle["value"]
- To update value: dictionaryTitle["key"]="value"
- Values can be any data type
- Syntax (key1:value1,...)
Información
- Descripción
- Computer Science Mapa Mental sobre Linear Data Structures, creado por Madison Miller el 02/02/2021.
- Creado por
- Madison Miller
- Visitas
- 0
- Valoración