5.2 Abstract Data Structures Flashcards
What is a variable?
A memory location to hold a specific size and type of data.
What is an array?
A declared size of memory space that can store related data.
What is important about arrays?
They are static - can’t be expanded
What are the advantages of arrays?
Easier to predict performance
Easier to predict how the program will run
more organised
static - so no unnecessary data stored.
What isa multi dimensional array?
2 or more data types saved in a certain spot. They have to be the same data type.
Code a multi dimension al array?
What is a tuple?
A special type of array with
An ordered set of values
Of mixed types
That can’t be changed
What is important to remember with a tuple?
Can’t be changed or expanded.
Code a tuple?
What are records?
A special type of array like tuples but that can be implemented like an object.
What are dynamic data structures?
Lists or Records that can grow or shrink as requested.
Record, Array, Tuple
Which are static?
Array and Tuple are static
Record, Array, Tuple
Which can grow and shrink?
None.
Record, Array, Tuple
Which can have multiple data types?
Array and Tuple
Record, Array, Tuple
Which must have a fixed number of items?
All of them.
Record, Array, Tuple
Which can have more than one dimension?
Array.
Record, Array, Tuple
Which can hold an item of the other two structures?
Array
What are stacks?
A stack is an abstract data type that holds an ordered, linear sequence of items. However it is a push pop structure.