Data Structures Flashcards
What is a 1 dimensional array defined as?
a finite set of elements of the same data type
What is a tuple?
A set of values which can be of any data type, but can not be changed.
What makes up a record?
several fields that each contain one item of data
What is an abstract data type?
A data type that has been created by the programmer.
How does a queue work?
Data can only be added to the end and Data can only be retrieved from the front.
Give some common examples of abstract data types? (4 things)
Queues, stacks, graphs and lists
What is a dynamic data structure?
A data structure that is able to increase or decrease the amount of space in memory it takes up.
What is the heap?
A portion of memory of which space is automatically allocated or de-allocated as required. This allows for dynamic data structures.
What is the main drawback of using dynamic data structures?
They can cause an overflow if they exceed the maximum memory limit which will cause data to be lost and the program to crash.
What are examples of dynamic data structures? (2 things)
queues, stacks
What is a static data structure?
A data structure that is fixed in size
What is an example of a static data structure?
array
What is the difference between a priority queue and a normal queue
In a priority queue the items are removed from the queue based on their priority, with the item with the highest priority being removed first, rather than being removed in the order they were added to the queue.
What is a list?
An abstract data type made up of items, in which the same item may occur more than once.
What does each node in a linked list contain?
The data field and a pointer field that points to the next item in the list