U3 AOS1: ADTS & Graphs Flashcards
Define ADTS
An abstract data type is a data structure and its allowable operations
Define sets
A collection of unordered and unique elements
Define arrays
A collection of elements of the same data type and a fixed length
Define lists
A collection of elements of any data type and a variable length (able to be appended or removed)
What are primitive operations?
Operations that
create, destroy, inspect, observe, or change the data structure
What are dictionaries
Unordered collection of {key,value} pairs, where the key is unique
What is a linked list?
A sequential access data structure, where each element can be accessed only in particular order.
What is a data structure and why are they useful?
A data structure is a particular way of organising the data so that it can be used efficiently. They provide a means to managing large amounts of data efficiently through algorithms.
What is an ADT
Combination of a data structure and its allowable operations
What does contiguous mean?
Adjacent to, neighbouring, touching
What is the role of arrays in data modelling?
They provide efficient access to elements by index, making them suitable for scenarios where fast random access is required.
They are useful for modelling fixed size elements, such as a book with its fixed number of pages. Other examples include coordinates
However, their fixed size is not suitable for situations where the size of the data can be changing/large
Role of lists in data modelling
Since arrays are not suitable for when the size of the data may be changing, lists allow for efficient insertion and removal of elements, making them useful for
1) task management
2) scheduling,
3) data processing
They are also used to model collections of similar information (such as friends invited for a party)
Roles of Sets in data modelling
They are useful when collecting SIMILAR unique objects, such as {Monday, Tuesday, wednesday} however they don’t allow for duplicate items
Roles of Dictionaries in data modelling
- They store key-value pairs, allowing efficient retrieval of values based on keys. They provide operations for insertion, deletion, and retrieval based on keys.
- If you need to quickly retrieve values based on known keys without iterating through the entire collection
Roles of Queues & Priority queues in data modelling
As they use the FIFO principle, they are particularly useful when we want the elements in a specific order. They are used largely in scheduling problems and project management.
Priority queues are used in hospitals (based of patient condition), or a airport runway