



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Exam; Professor: Howe; Class: Algorithms and Data Structures; Subject: Computer Science; University: Colorado State University; Term: Spring 2004;
Typology: Exams
1 / 6
This page cannot be seen from the preview
Don't miss anything!




b) [3 pts] Give an example of casting in Java. __________________________________________________________________ _c)_ [3 pts] What is the command to give the owner read and write permissions and groups and others read only permissions to the file "index.html"? __________________________________________________________________ d) [3 pts] You are running program "java prog1". What is the command to redirect both standard out and standard error into "output.log"? __________________________________________________________________ e) [3 pts] What color does eclipse display "standard error" as in the console window? __________________________________________________________________ b) [10 pts] In assignment 2, you used mergesort to sort the Contacts file. So assignment 1 and 2 required two approaches to the same problem: creating a sorted ArrayList by reading in strings from a file. Which approach is better for this problem? (Circle one and justify your response based on efficiency and use considerations) BinarySearch+Insert OR MergeSort c) [10 pts] Assume you were being asked to program a class for keeping track of the allowed email Contacts. The calling code will need to confirm whether a given contact (of type String) is an allowed email address. You get a choice of data structure for storing the Contacts. Which data structure is better for the Contacts? (Circle one and justify your response based on efficiency and use considerations) Ordered ArrayList OR Ordered Doubly Linked List