This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 1 Abstraction 6 What is an abstract datatype? 4 Why is abstraction important? 6 A queue is often implemented by encapsulating a list, remapping enqueue and dequeue to list operations, and not providing the remaining list operations. In short, a queue provides strictly less functionality than a list. What would be wrong with simply providing a list with the enqueue and dequeue methods added? You must be more specific than simply saying violates abstraction. 1 2 Lists 4 Suppose you have an application in which you have a large amount of data. You happen to know that the number of elements will change very little over the course of the program, and you also know the upper bound. What implementation of lists will you choose for this application? 6 If a list class does not have a tail pointer, methods that insert, return, modify, or delete the final element of the list take O ( n ) time. If the class does have a tail pointer, some of these operations are faster, but not all of them. Selecting from this class of operations, give one operation that is faster with a tail pointer (and its new time complexity) and one that is not....
View Full Document
This note was uploaded on 10/03/2008 for the course CS 350 taught by Professor Hood during the Spring '08 term at Illinois Tech.
- Spring '08