Data Structures Flashcards
What is an array?
An ordered finite set of elements of a single type.
What type of array is a linear array?
A one-dimensional array.
How can you visualise a two-dimensional array?
As a spreadsheet or table.
How can you visualise a three-dimensional array?
A three dimensional array can be visualised as a multi-page spreadsheet.
What is a record also known as?
A row in a file.
What is a record made up of?
A record is made up of fields.
How can you select a field from a record using pseudocode?
recordName.fieldName.
What is the definition of a list?
A data structure consisting of a number of items in which the items can occur more than once.
What are the main differences between arrays and lists?
- Lists can store data non-contiguously whereas arrays store data in order. - Lists can store data of more than one data type.
What is a tuple?
An immutable ordered set of values of any type.
What is the difference between a tuple and an array?
Tuples are initialised using regular brackets instead of square brackets.
What is a linked list?
A dynamic data structure used to hold an ordered set of items which are not stored in contiguous locations.
What is the name given to the items in a linked list?
Nodes.
What does each item in a linked list contain?
It contains a data field and another address field called a link pointer.
What is a data field in a linked list?
A field that stores the actual data.
What is a pointer field in a linked list?
A field that contains the address of the next item in the list.
What is a graph?
A graph is a data structure consisting of a set of vertices (nodes) connected by edges (arcs).
What is a directed graph?
A graph in which the edges can only be traversed in one direction.
What is an undirected graph?
A graph in which the edges can be traversed in both directions.
What is a weighted graph?
A graph in which the arcs (edges) have a cost to traverse.