Whats ADT stand for | Abstract Data Type |
Give some examples of Abstract Data Types | queue
stack
graph
tree
hash table
dictionary
vector |
What is a set? | Collections of data with no order |
Whats a primitive data type? | A data type that is built into a programming language, or one that could be characterized as a basic structure for building more sophisticated data types |
What is a composite data type | A composite data type is a datatype made of other datatypes
e.g. array, lists etc... |
Give some examples of composite data types | arrays, lists, and strings |
Give some examples of primitive data types | Integer, double, character, bool |
What is an Abstract Data Type | A logical description of how the data is viewed and the operations that can be performed on it. |
Describe a sequence of items | Each item (except the first) will have a predecessor; each item (except the last) will have a successor |
Whats the difference between an Abstract Data Type and a Data Structure | An ADT can be implemented in different ways |
State the advatantages of static structures | Takes same constant time to access any elements n the array |
State the disadvatantages of static structures | Waste of space, as they have to be overdimensioned
Limited amount of space
Can take longer to add and remove items |
State the advatantages of dynamic structures | Only use the memory needed, avoid wasting memory space
Flexible to grow and shrink |
State the disadvatantages of dynamic structures | Resize operation takes time
In dynamic structures such as a linked list the access time depends on the position of the element in the structure
Storage overhead for pointers (linked lists and trees) |
Define what a static data type is | A datatype that cannot change at runtime |
Define what a dynamic data type is | A datatype that can change at runtime |
What are pointers for datasystems? | Pointers are the variables that are used to store the location of value present in the memory |
What are some of the difference between static and dynamic datastructures? | Static datastrutures have storag size determined at complie time whereas dynamic strcutures can change at run time
Static data stuctures have a fixed size but dynamic structures can change
Dynamic structures require more memory space casue of pointers
Static data structures can waste storage space if the number of elemnets to store is less than the size whereas dynamic is alwsays excactly whast needed
Static data types TYPICALLY store data in consecutive meomory locations but dynamic structures TYPICALLY dont |