DOC PREVIEW
UMD CMSC 132 - Final Exam

This preview shows page 1-2-3-4 out of 12 pages.

Save
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Grader Use Only 1 CMSC132 Fall 2005 Final Exam First Name Last Name 2 20 3 20 4 20 5 20 6 20 7 20 8 20 9 20 10 20 Student ID Total Section time Honors TA I pledge on my honor that I have not given or received any unauthorized assistance on this examination Your signature General Rules Read This exam is closed book and closed notes If you have a question please raise your hand Total point value is 200 points Answer True False questions by circling the T or F at the end of the question Answer essay questions concisely using 1 or 2 sentences Longer answers are not necessary and are discouraged WRITE NEATLY If we cannot read your answer it will not be graded i e 0 credit 1 20 200 20 Problem 1 Software Engineering Object Oriented Design 20 pts A 4 pts Software engineering a What is the main reason many software projects fail b What is the software life cycle c According to the waterfall model design all algorithms before coding T or F d According to the unified model design all algorithms before coding T or F e What is the difference between program verification and empirical testing B 4 pts Object oriented design a State behavior and identity are the main qualities of objects b Object oriented design produces faster programs c What are two main principles of object oriented design T or F T or F C 4 pts Object oriented design II Given the following problem description produce an objectoriented solution Answer the following questions about your object oriented solution Design a simulation of a basketball conference Each conference has 10 teams Each team has 12 players Each player has a specific height speed and accuracy Players know which team they belong to Some players are scholarship players Scholarship players need to record their current grade point average Players may be transferred between teams Teams play basketball games against other teams in the conference The result of each game is determined using a function based on the height strength speed and accuracy of the players on each team a b c d e What are the objects in your object oriented solution What are the interactions between your objects Which objects have other objects Also list target object Which objects use other objects Also list target object Which objects are other objects Also list target object 2 D 4 pts UML Given the following Java code draw its UML class diagram Provide as many details as possible public class Propeller public double thrust public int mileage public class Engine public double power public int mileage public class Plane public Propeller myPropellers public Engine myEngine public class Pilot public int flightHours public void fly Plane p public class FighterPilot extends Pilot public int rank Problem 2 Algorithmic Complexity 20 pts E 4 pts Algorithmic complexity a What is algorithmic complexity b List a reason benchmarking is better than analyzing complexity c What is the difference between best case worst case and average case d What does the Big O notation represent 2 e Why are O n and O n not considered equivalent F 4 pts Finding critical regions Calculate the asymptotic complexity of the code snippets below using big O notation with respect to the problem size n a for i 0 i n i i 2 for j 1 j n j f n O 3 b for i 0 i n 2 i for j 0 j n j j 2 for k 1 k 5000 k k 5 for j 0 j 1000 n j j 1 for j 0 j n 5 j j 5 f n O Problem 3 Data Structures and Recursion 20 pts G 4 pts Taxonomy properties a Describe the main difference between linear and hierarchical data structures b What is the key property of a binary search tree c On average what is the complexity of doing an insertion in a binary search tree d Pre order in order and post order are all depth first traversals T or F e What operation s supported by binary search trees are not supported by heaps f What is the difference between a set and a map g What happens when an open addressing hash table is close to full h Describe the 2 main parts of a recursive algorithm Problem 4 Graph Algorithms 20 pts H 4 pts Properties a Describe the main difference between hierarchical and graph data structures b Describe the difference between a directed and undirected graph c Describe the difference between a path and a cycle d Describe two methods of storing edges in a graph e Which method of storing edges in a graph requires more space 4 I 4 pts Traversals a Why is graph traversal more difficult than a tree traversal b Describe the difference between a breadth first and depth first traversal of a graph c Given the following Java class definition for a graph public class Node Object myValue boolean tag ArrayList Node myNeighbors public class myGraph ArrayList Node myNodes void visitNode Node n Action to be performed when traversing node void deptFirstSearch Node n Perform depth first search of graph starting at n Write code for deptFirstSearch n to perform a depth first traversal of nodes in the graph invoking visitNode for each node once J 4 pts Minimum spanning trees a What is a spanning tree b Describe Kruskal s algorithm for finding minimum spanning trees c Describe two methods for finding connected subgraphs d Consider the following graph Using Kruskal s algorithm calculate the minimum spanning tree listing edges in the minimal spanning tree in the order they are added to the tree 16 S 10 A 12 14 8 B C 9 13 5 15 E D 4 5 6 7 3 F G H 11 K 4 pts Single source shortest path a Describe Djikstra s algorithm for finding shortest paths in a graph b Consider the previous graph Apply Djikstra s algorithm for this graph to calculate the shortest path from S to every other node Store intermediate results in the table BestKnownDistances Show the entries in the table after you finish computing the shortest distance from S to nodes in the set S A B Table BestKnownDistances S A B C D E F G H LowestCost Predecessor c Which node would be processed next using Djikstra s algorithm d Update the table BestKnownDistances after adding this node e Using Djikstra s algorithm calculate the shortest path and its cost from S to every other vertex in the graph List vertices in the order they are added to the table BestKnownDistances Problem 5 Compression Huffman Codes 20 pts L 4 pts Compression a What are two sources of compressibility b What are two types of compression c What is a prefix code d What are Huffman codes e How do Huffman codes achieve compression f Given the following Huffman tree decode the sequence 00110010 T S 1 0 1 R 0 1 6 A 0 g Using the same Huffman tree encode the


View Full Document

UMD CMSC 132 - Final Exam

Documents in this Course
Notes

Notes

8 pages

Recursion

Recursion

12 pages

Sorting

Sorting

31 pages

HTML

HTML

7 pages

Trees

Trees

19 pages

HTML

HTML

18 pages

Trees

Trees

19 pages

Honors

Honors

19 pages

Lecture 1

Lecture 1

11 pages

Quiz #3

Quiz #3

2 pages

Hashing

Hashing

21 pages

Load more
Loading Unlocking...
Login

Join to view Final Exam and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Final Exam and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?