




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
The instructions and questions for the computer science examination for the bachelor of science (honours) in software development program at the cork institute of technology. The examination covers topics such as graph theory, recurrence relations, and algorithm complexity. Students are required to answer questions related to drawing non-isomorphic graphs, finding euler circuits and paths, solving recurrence relations, and analyzing algorithmic structures.
Typology: Exams
1 / 8
This page cannot be seen from the preview
Don't miss anything!





Semester 1 Examinations 2009/
Module Code: COMP 8011
School: School of Computing & 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: Winter 2009
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) Let V = { a, b, c, d, e, f}. Draw three non-isomorphic loop-free simple graphs G 1 = (V, E 1 ), G 2 = (V, E 2 ), G 3 = (V, E 3 ) where, in all three graphs, we have deg(a) = 3, deg(b)= deg(c) = 2 and deg(d) = deg(e) = deg(f) = 1. Note that marks will be deducted if you draw any isomorphic graphs. (7 marks) (b) For which value(s) of n ≥ 2 does K (^) n have an Euler circuit? For which value(s) of n ≥ 2 does K (^) n have an Euler path but not an Euler circuit? For which value(s) of n ≥ 2 does K (^) n have a Hamilton cycle? Justify your answers. (7 marks) (c) Solve the following recurrence relation: h 0 = 2 h 1 = 4 hn = hn-1 + 6 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), 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) Is it possible to assign each of 100 students the use of one of 40 computers if each computer is used by exactly one or three students? (6 marks) (b) How many different channels are needed for 6 TV stations, if no two stations within 150 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 175 200 50 100 2 125 175 100 160 3 100 200 250 4 210 220 5 100
Q4. (a) What is meant by a prefix code? Using Huffman’s algorithm, devise an optimal binary prefix code for these characters: a, b, c, d, e, f and g assuming their frequencies of occurrence are 45, 12, 8, 21, 76, 22 and 33 respectively. (8 marks) (b) Deduce that the graph G (see Figure 1) is non-planar by finding a subgraph homeomorphic to K (^) 3,3. (8 marks) (c) What are NP-complete problems? Give three examples. Why are they important in the study of algorithm complexity? (9 marks)
Q5. (a) Outline the steps in the enumeration sort algorithm. Describe a parallel implementation for the algorithm and apply it to the input 14, 5, 8, 20, 2, 10. Compare the complexities of the sequential and parallel implementations of enumeration sort. (15 marks) (b) Outline Prim’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. (10 marks)
Q6. (a) Outline Dijkstra’s algorithm to find shortest path between two nodes in a weighted connected graph and apply it to find the shortest path from the node A to the node Z in the weighted graph W (see Figure 3). You may detach the page containing copies of Figure 1 and use it to indicate clearly the intermediate steps in the computation. Remember to sign your name on the page and submit it with your answer book. (10 marks) (b) What is the time complexity, expressed in big-oh notation, of a recursive algorithm whose associated recurrence relation is T(1) = 1 T(n) = 2 T(n/2) + C n, n > 1 where C is a positive constant. Assume that n = 2 k , k an integer > 0 (10 marks)
a
b
c
i h
d
e
g
f
10
9
4 4
3
6
8 7
20 16
27 10 A
B
D
C
E
F
Z
10
9
4 4
3
6
8 7
20 16
27 10 A
B
D
C
E
F
Z