final exam review

final exam review - 1 Abstraction 6 What is an abstract...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the 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.

Page1 / 9

final exam review - 1 Abstraction 6 What is an abstract...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online