Linear Data Types Flashcards
What is a data structure?
Collection of data value arranged according to some rules (normally a collection of primitive data types).
What is an array?
An array is a fixed size collection of vales that have the same data types
What is does static mean?
Fixed size
What does homogeneous mean?
Same data type
What is the index of the first and last number in an array?
The first number is 0, the last number is length -1.
What the difference between list and an array?
A list is dynamic - essentially an array that can grow and shink
What is an Array list?
It is an array that has space to grow but if it reaches its limit, you need to create a new one.
What is a linked list?
A linked list is where every item has a pointer to the next item and it has no underlying data type.
What can u do with lists?
Append - length gets increased by one
Prepend - adds an item to the beginning so the list also appends
Insert - adds an item and every index number is increased
Remove - gets rid of an item so every index number is decreased
What is a multi-dimensional array?
A 2D one is like a table but a 3D one needs three indices to specify an element
What is a tuple?
A tuple is like an array but it is heterogeneous so it can have multiple data types
What is a record?
Uses labels instead of numeric indices, it can have different data types like tuples but they allow their values to change (mutate)
FIFO
First in last out. A queue is an example of this
LIFO
Last in first out. A stack is an example of this data structure