



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Autumn Examinations 2010
Module Code: COMP 8011
School: School of Computing and Mathematics
Programme Title: Bachelor of Science (Honours) in Software Development
Programme Code: KSDEV_8_Y
External Examiner(s): Ms. A. Meagher Internal Examiner(s): Dr. J. Stynes
Instructions: Answer 4 questions. Show all work.
Duration: 2 hours
Sitting: Autumn 2010
Requirements for this examination:
Note to Candidates: Please check the Programme Title and the Module Title to ensure that you have received the correct examination paper. If in doubt please contact an Invigilator.
Q1. (a) True or False? Justify your answers. Letļ ļ£(G) be the chromatic number of graph G. (i) if G contains the complete graph Kr as a subgraph, then ļ£(G) ļ³ļ r. (ii) if ļ£(G) ļ³ļ r, then G contains the complete graph Kr as a subgraph. (8 marks) (b) Is it possible to have a connected planar graph with at least 3 vertices and each vertex having degree ļ³ 6? Justify your answer. (6 marks) (c) Solve the following recurrence relation: h 0 = 1 h 1 = 2 hn = hn-1+ 15 hn-2, n > 1 (8 marks) (d) What is the complexity of the following code segment assuming f(), g() and h() are functions whose complexities have been determined as O(n^2 ), O(n log n) and O(1) respectively? x = f(); g(); y = h(); (3 marks)
Q2. Provide a graph model for each of the following problems and then solve the problem. The solution MUST be obtained by using a graph theory result. (a) John has invited 10 people to a party. The 11 people at the party are all acquainted with exactly 6 others. Can John seat them at a round table in such a way that everybody has someone that he/she is acquainted with on either side? (6 marks) (b) How many different channels are needed for 6 TV stations, if no two stations within 175 kilometres of each other can operate on the same channel, and the distances between the stations are as follows? (6 marks) 1 2 3 4 5 6 1 85 100 200 70 150 2 125 250 100 200 3 120 220 180 4^190 5 100
Q4. (a) Consider the two graphs G 1 and G 2 in Figure 1. Decide if they are isomorphic or not. If they are isomorphic, find a vertex correspondence. If they are not isomorphic, list minimal changes that could be made to G 2 to make them isomorphic and find the vertex correspondence in this case. (12 marks) (b) Analyse the complexity of the recursive function func assuming S 1 and S 2 are blocks of code of complexity O(1). int func( int n ) { if ( n = = 1 ) S 1 ; //S 1 is O(1) else if ( n = = 2) S 2 ; //S 2 is O(1) else return( 2 func(n-1) + 5 func(n-2); }** (13 marks)
Q5. (a) Jane is in charge of assigning part-time jobs at a college. She has 25 student applications and there are 25 part-time jobs. Each applicant is qualified for at least 4 jobs but each job can be performed by at most 4 applicants. Can Jane assign all students to jobs for which they are qualified? Model and solve this as a graph problem. (7 marks) (b) Outline Kruskalās algorithm to find a minimal spanning tree in a given graph. Apply it to the graph H (see Figure 2). Indicate clearly how the algorithm is used in finding the minimal spanning tree at each step. No marks will be awarded for a correct minimal spanning tree if it is not demonstrated clearly that the algorithm was used. (9 marks)
. (c) What are NP-complete problems? Give three examples. Why are they important in the study of algorithm complexity? (9 marks)
Q6. (a) Find a Hamilton cycle in the graph M (Figure 3), or prove using the ā3 rulesā method that no Hamilton Cycle exists. (10 marks) (b) Devise a parallel algorithm with complexity better then O(n^2 ) to search an n x n array for an item X assuming n processors are available. What is the time complexity of your algorithm? (15 marks)