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, reachability matrices, matrix multiplication, rooted trees, and recursion. Students are required to answer questions related to finding subdivisions of graphs, defining homeomorphic graphs, proving results, and computing reachability matrices. They are also asked to find the chromatic number of graphs and design traffic light patterns.

Typology: Exams

2012/2013

Uploaded on 03/28/2013

beboo
beboo 🇮🇳

4.4

(14)

242 documents

1 / 8

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
(Bachelor of Science in Computer Applications – Stage 3)
(NFQ – Level 8)
Autumn 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) List all elementary subdivisions of the following graph:
[4 Marks]
b) Define the term homeomorphic. [3 Marks]
Give an example of a graph which is homeomorphic to the graph shown in part (a) above,
but is not equal to this graph.
[2 Marks]
c) Prove the following result:
In any graph or multigraph, the number of vertices of odd degree is even.
[6 Marks]
d) Show that the HAMILTON CYCLE problem is reducible in polynomial-time
to the TRAVELLING SALESMAN problem (TSP).
[10 Marks]
d
a
b
c
pf3
pf4
pf5
pf8

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

(Bachelor of Science in Computer Applications – Stage 3)

(NFQ – Level 8)

Autumn 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) List all elementary subdivisions of the following graph:

[4 Marks]

b) Define the term homeomorphic. [3 Marks]

Give an example of a graph which is homeomorphic to the graph shown in part (a) above, but is not equal to this graph. [2 Marks]

c) Prove the following result: In any graph or multigraph, the number of vertices of odd degree is even. [6 Marks]

d) Show that the HAMILTON CYCLE problem is reducible in polynomial-time to the TRAVELLING SALESMAN problem (TSP). [10 Marks]

d

a • b

c

Question 2 a) Determine if the following graphs G 1 and G 2 are isomorphic or not. If they are not isomorphic, show this to be the case. If they are isomorphic, list any one of the isomorphisms? Prove that the one you list is an isomorphism. Detail the steps that you used in arriving at your answer. Most marks are awarded for your approach to answering the question. A correct yes/no type of answer without the steps used to arrive at the answer fully explained and detailed will attract zero marks. [10 Marks]

b) How many edges has the hypercube Qn? Justify your answer. [5 Marks]

c) What is the complexity of the following code segment? for (i=0; i<n ; i++)

for(j=n; j>i ; j--)

for (k=1; k<y; k++)

S where S is a statement whose complexity is O(1) and y is another variable?

(Assume that the input size is n)

Show detailed workings carefully. [10 Marks]

A

G

B

C

F E D

T

Z

Y

U

X W

V

G 1 :

G 2 :

Question 4

a) Define what is meant by a rooted tree. [2 Marks]

Define what is meant by a rooted m-ary tree being complete. [2 Marks]

Define what is meant by a rooted tree being balanced. [2 Marks]

What is the relationship between the height and the number of leaves in a complete m-ary tree? [2 Marks]

What is the relationship between the height and the number of leaves in a complete m-ary tree which is also balanced? [2 Marks]

b) The management structure in organization X is a tree structure, in which every manager manages 4 people and may have another manager managing him/herself. If the organization has 865 employees in total, how many employees are not managers? [5 Marks]

c) Solve the following recurrence relation h (^) n = 4h (^) n-1 - 3h (^) n-2 , n2 h 0 = 2 h 1 = 4 [6 Marks]

Check your solution by computing h 3. [4 Marks]

Question 5

a) Find the Chromatic number of the following graphs

[3 Marks]

[3 Marks]

A

H

L

F

I

M

K

B

J

D

G C

E

A

F B

E D C

Question 6

a) Using Dijkstra’s algorithm, find the shortest path from vertex N to vertex R in the following graph. Demonstrate clearly that you have used the algorithm to arrive at the solution.

In particular, list the order in which the labels on the nodes are made permanent. [7 Marks]

N

f

b i e

m d

j g c

k

h R

b) 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.

[8 Marks]

c) What is the prefix problem? Give an example to illustrate your answer. [2 Marks]

Give a sequential algorithm to address the parallel prefix problem. [3 Marks]

Work out its complexity? [3 Marks]

Describe a parallel algorithm to address the parallel prefix problem. [2 Marks]

A

B

C

D

E

G

F