Topic 2 - Fundamentals of data structures Flashcards
Define data structure?
Is the format used to efficiently store & organise a collection of related data items
Define array?
A data structure made up of a list of data elements that are the same data type or size
Example of a one-dimensional & two-dimensional array?
List
Table
Define text files?
Store data in humanly readable format
Define binary files?
Store data which is not in a humanly readable format, must be interpreted by a program or hardware.
Define static data structure?
Data storage method where the amount of data and memory allocated is fixed. e.g. an array
Define dynamic data structure?
Data storage method where the amount of data and memory allocated is varied to meet the needs of the application using it. e.g. a vector
One advantage of static data structures?
Memory addresses will be allocated at compile time, so will be fixed and contiguous, permitting faster access
One advantage of dynamic data structures?
Meets the needs of the application, effiecient use of memory
Define a queue?
Is used as a temporary storage space for data.
An abstract data structure which operates on FIFO.
Define a linear queue?
Is a FIFO data structure organised as a list of data
Define a circular queue?
Is a FIFO data structure organised in a ring formation
Define a priority queue?
Is similar to a regular queue except that each element is assigned a priority and the highest-priority are served first
Define a stack?
Is an abstract data type which uses FILO
What are the 3 operations which can be performed on a stack?
- Push
- Pop
- Peek (or top)
What does the push operation do on a stack?
Adds items of data to the top of the stack
What does the pop operation do on a stack?
Removes the last item of data from the stack
What does the peek operation do on a stack?
Reads the top element in the stack without removing it from the stack
Define a graph?
Used to represent complex relationships such as computer interconnection drawings.