Data types and structure

Cards (22)

  • How do you describe a 3d array
    A cube of data
  • what is the definition of a record
    a record is a collection of repeated data items often of different data types , group together as a unit
  • what is the definition of a list
    A list is a collection of different data types and are mutable
  • what is the definition of a tuple
    a tuple is like a list but immutable
  • what is the definition of immutable
    elements can’t be changed once the data structure is created
  • What is the definition of stack
    A data structure that uses the LIFO principle
  • what is the definition os a queue
    a data structure that uses the FIFO priciple
  • what is the LIFO principle
    Last In First Out
  • what is the FIFO principle
    First In First Out
  • what are the operations of a stack
    • push
    • pop
    • peek
  • what does the push function do?
    puts an item on the top of the stack
  • what does the pop function do?
    removes the top item on a stack
  • what does the peek function do?
    it looks at the top item on a stack but doesn’t remove it
  • what are the operations for a queue?
    • enqueue
    • dequeue
  • what does the enqueue function do?
    adds an item to the queue
  • what does the dequeue function do?
    removes an item from the queue
  • what type of array is this:
    array = [1,2,3]
    1D
  • what type of array is this:
    array = [[1,2,3],[4,5,6],[7,8,9]]
    2D
  • what type of array is this:
    array = [ [ [1,2],[3,4]],
    [5,6],[7,8],
    [9,10],[11,12] ]
    ]
    3D
  • what is this code defining:
    student = {
    “name”:”John Doe”,
    “age”:21,
    “grade”:”A”
    }
    a record
  • what data structure:
    data = [1,”hello”,3.14]
    list
  • what data structure is this:
    data = (1,”world”,2.71)
    tuple