GoConqr has a new look! Let us know what you think.

Mind map

DATA STRUCTURES

Danielle Dietz English

Map content

DATA STRUCTURES

  1. LISTS

    • [...,...,...,...]
    • Changeable, ordered, allow duplicates
    • CAN include elements w different data types
    • Adding a element to a list → place it at the end EX:myList.append
    • When deleting an element from a list → remove or pop EX: myList.remove(“”) OR myList.pop(“”)
    • Access an element in a list, use the square brackets (w placement in list (starts w 0)) Item = myList[2]
  2. TUPLES

    • (...,...,...,)
    • Used to store multiple items in a single variable
    • Ordered, unchangeable, and allow duplicates
  3. SETS

    • Unordered, unchangeable, reject duplicates
    • Elements w different data types
    • mySet - {..,...,...}
    • Don't use indices to access sets BUT can Loop to see their items EX: for x in mySet: print (x)
    • Can also check (TRUE or FALSE) in an element exists in Set EX: print(“banana” in mySet)
    • Can add elements to set using .add(...)
    • Merge sets using .update(...)
  4. DICTIONARIES

    • Store data in key:value format
    • Very powerful structures to describe items
    • Values in dictionary can be of any datatype EX: carOnSale = { “Brand”: “Toyota”, “Year”: 2018, }
    • When printed: {key1:value1, …, …}

Information

Description
Mind Map on DATA STRUCTURES, created by Danielle Dietz on 12/09/2021.
Created by
Danielle Dietz
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?