4.2 (DATA STRUCTURES) Flashcards

1
Q

Properties of an array

A

Hidden index - Array[0]
defined scope- defined size

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Properties of a record/ database

A

Data unordered but can be ordered using primary keys and can also be organised with attributes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Properties of a list

A

Ordered set of data, organised by index value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Properties of a tuple

A

A tuple is an ordered set of values of any type

It is immutable, this means that it can’t be changed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Name the operations that can be done to a list (8)

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Properties of a stack

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly