Which of the following best describes an Abstract Data Type (ADT)?
Think about whether ADT focuses on 'what' or 'how'.
An Abstract Data Type defines what operations are available and their behavior, but not how they are implemented. It is a conceptual model.
Which statement correctly describes a data structure?
Consider if data structure is about theory or practical storage.
A data structure is a specific way to organize and store data in memory, enabling efficient access and modification.
Which of the following pairs correctly matches an Abstract Data Type with a typical data structure implementing it?
Think about common implementations of queues and stacks.
A queue ADT is often implemented using a linked list to allow efficient insertion and removal from ends. Stacks are usually implemented with arrays or linked lists, hash tables are for key-value pairs, and sets can be implemented with trees or hash tables.
Why is it important to distinguish between an Abstract Data Type and its data structure implementation?
Consider the benefits of separating interface from implementation.
Separating ADT from data structure allows programmers to change the underlying implementation without affecting how the data is used, promoting flexibility and modularity.
Consider a Stack ADT implemented using an array versus a linked list. Which of the following is a true difference caused by the choice of data structure?
Think about memory allocation differences between arrays and linked lists.
Arrays have a fixed size determined at creation, limiting growth, while linked lists allocate nodes dynamically, allowing the stack to grow as needed.