Computer Science Exam Questions - Cork Institute of Technology, Exams of Computer Science

Exam questions from a computer science bachelor's degree course at cork institute of technology. The questions cover topics such as graph theory, algorithms, and data structures. Students are required to answer a specified number of questions, and the exam is worth a total of 30 marks. The examiners are listed at the beginning of the document.

Typology: Exams

2012/2013

Uploaded on 03/28/2013

beboo
beboo 🇮🇳

4.4

(14)

242 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Cork Institute of Technology
Bachelor of Science (Honours) in Computer Applications – Stage 3
(NFQ Level 8)
Summer 2005
COMPUTER SCIENCE
(Time : 3 Hours)
Answer any four questions. Examiners : Dr. D. Chambers
Mr. P. O' Connor
Mr. T. Parslow
Mr. V. Ryan
Question 1
(a) What is the four-colour theorem, and what is its significance?
[4 Marks ]
(b) You are assigned the job of scheduling exams for the subjects
S1,S2,S3,S4,S5,S6,S7,S8,S9 using the least number of time slots. The restriction is that a pair
of exams which are taken by the same student cannot be scheduled into the same time slot.
The following pairs of subjects have at least one student who is taking both exams:
S1 and S2, S1 and S9, S2 and S3, S2 and S7, S2 and S9, S3 and S5, S3 and S6, S3 and S7, S3
and S9, S4 and S8, S4 and S9, S5 and S6, S5 and S8, S6 and S9, S7 and S8, S7 and S9.
Use a graph to model the problem.
Use the Welsch-Powell algorithm to colour the graph, and deduce the minimum number of
time slots and how the exams could be distributed over the time slots. Show all workings
clearly
[11 Marks ]
(c) Explain why the theory of the classification of problem scan be narrowed to decision problems
only. Give details.
As part of your answer, show how the Travelling Salesman Problem is transformed to an
equivalent decision problem.
[10 Marks ]
pf3
pf4
pf5

Partial preview of the text

Download Computer Science Exam Questions - Cork Institute of Technology and more Exams Computer Science in PDF only on Docsity!

Cork Institute of Technology

Bachelor of Science (Honours) in Computer Applications – Stage 3

( NFQ Level 8)

Summer 2005

COMPUTER SCIENCE

(Time : 3 Hours)

Answer any four questions. Examiners : Dr. D. Chambers Mr. P. O' Connor Mr. T. Parslow Mr. V. Ryan

Question 1 (a) What is the four-colour theorem, and what is its significance? [4 Marks ]

(b) You are assigned the job of scheduling exams for the subjects S1,S2,S3,S4,S5,S6,S7,S8,S9 using the least number of time slots. The restriction is that a pair of exams which are taken by the same student cannot be scheduled into the same time slot. The following pairs of subjects have at least one student who is taking both exams: S1 and S2, S1 and S9, S2 and S3, S2 and S7, S2 and S9, S3 and S5, S3 and S6, S3 and S7, S and S9, S4 and S8, S4 and S9, S5 and S6, S5 and S8, S6 and S9, S7 and S8, S7 and S9. Use a graph to model the problem.

Use the Welsch-Powell algorithm to colour the graph, and deduce the minimum number of time slots and how the exams could be distributed over the time slots. Show all workings clearly [11 Marks ]

(c) Explain why the theory of the classification of problem scan be narrowed to decision problems only. Give details. As part of your answer, show how the Travelling Salesman Problem is transformed to an equivalent decision problem. [10 Marks ]

(a) Consider the following digraph. What vertices can be reached from vertices B and C along a path of length 4? Your answer must involve matrix multiplication.

[6 Marks ]

(b) Explain the two methods that we use to find the reachability matrix for a graph, and compare these methods. Give details. [5 Marks ]

(c) What type of graphs are the Qn graphs? Give an example by showing Q 2 and Q 3. [4 Marks ]

(d) Analyse the complexity of the following (nonsensical) code. Assume that the problem input size is n. Show all workings clearly.

int i, j, x,sum; for ( i=1; i<100000; i++ ) for ( j=n; j>i; j-- ) if ( a[j-1] > a[j] ) { x = a[j-1]; a[j-1] = a[j]; sum=0; for(k=1; k<=n; k=10) sum+=a[k]; a[j] = x; }*

[10 Marks ]

D

C

B

A

E

(a) List and justify the four guidelines which we use for determining whether or not a graph has a Hamilton Cycle. [4 Marks ]

Using these guidelines, determine whether the following graph has a Hamilton Cycle or not. If it has a Hamilton Cycle, find one such cycle. [6 Marks ]

(b) Prove that in any graph or multigraph, the number of vertices of odd degree is even.

(c) Find the time complexity of the following recursive code? Show all workings clearly.

void g( int X, int Y, int Z, int n) // n will be positive { if ( n ==1 ) cout << “stop here” else { g( X, Z, Y, n-1); cout << “n is ” << n << endl; g( Z, Y, X, n-1); } } [10 Marks ]

D C

I H

K

J G

F

E B

A

(a) What is meant by the term elementary subdivision? Use an example to enhance your answer. [3 Marks ]

(b) Consider the following graph. Test and decide if it is planar or not. If it is planar, verify Euler’s Formula for the graph. If it is non-planar, verify Kuratowski’s theorem for this graph. [6 Marks ]

(c) Prove that if T is a connected multigraph with n vertices and no circuits, then T has n-1 edges.

[6 Marks ]

(d) From the definition of big-Oh, show that O(n 4 ) * O(n 2 ) = O(n 6 ) [6 Marks ]

(e) Using a suitable example, explain why space complexity and time complexity are often inversely related. i.e. when you improve space requirements, you disimprove time requirements. [4 Marks ]

b

c

d

f e

g

h

i

a

(b) What is a spanning tree? [2 Marks ]

Using Kruskal’s Algorithm, find a minimum spanning tree for the following graph. Show all workings clearly. Demonstrate clearly that you have used the algorithm to arrive at the solution.

[6 Marks ]

(c) Using an example, explain why some algorithms may be parallelised and others can’t. [3 Marks ]

Outline the parallel Enumeration Sort algorithm. Give a time complexity analysis of the algorithm. What would its complexity be if it were run on a uniprocessor? Explain your answer. [7 Marks ]

A

B

C

D E

G

F