4.2 (DATA STRUCTURES) Flashcards
Properties of an array
Hidden index - Array[0]
defined scope- defined size
Properties of a record/ database
Data unordered but can be ordered using primary keys and can also be organised with attributes
Properties of a list
Ordered set of data, organised by index value
Properties of a tuple
A tuple is an ordered set of values of any type
It is immutable, this means that it can’t be changed
Name the operations that can be done to a list (8)
list.isEmpty()
list.append(value)
list.remove(value) —Removes the value the first time it appears in the list
del list[index]
len(list)///list.length()
list.index(value)— Returns the position of the given item
list.insert(position,value)
list.pop()—Removes and returns the last value
Properties of a stack
A stack is a last in first out (LIFO) data structure
Items can only be added to or removed from the top of the stack