Hamilton Cycle - Computer Science - Exam, Exams of Computer Science

Main points of this past exam are: Complete Graphs, Complete Biparite Graphs, Hamiltonian, Hamilton Cycle, Repeated Roots, Recurrence Relations, Linear Recurrence, Graph Theory, Odd Degree, Euler Circuit

Typology: Exams

2012/2013

Uploaded on 03/28/2013

beboo
beboo šŸ‡®šŸ‡³

4.4

(14)

242 documents

1 / 11

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
a b c d e
f
g h i
j
k l mn o
Cork Institute of Technology
Bachelor of Science (Honours) in Software Development - Stage 3
Autumn 2007
Computer Science
(Time : 3 Hours)
Answer any four questions. Examiners : Mr. V. Ryan
Dr. M. O Cinneide
Mr. M. Donnelly
Question 1
a) Which of the following graphs are Hamiltonian (have a Hamilton Cycle) and explain why?
i. the complete graphs Kn
ii. the complete biparite graphs Ki,j
iii. trees [7 Marks]
b) Using the four rules discussed in class for determining whether or not a graph has
a Hamilton Cycle, determine whether the following graph a Hamilton Cycle or not.
If it has a Hamilton Cycle, find one such cycle.
[8 Marks]
c) Explain how we deal with repeated roots in the solving of linear recurrence relations.
[3 Marks]
d) Solve the following linear recurrence relation:
h0 = 0
h1 = 2
hn = 5hn-1 + 9hn-2, n>1.
Verify your answer by checking the value of h4.. [7 Marks]
• •
•
•
•
•
•
•
•
•
•
•
•
•
•
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Hamilton Cycle - Computer Science - Exam and more Exams Computer Science in PDF only on Docsity!

a b c d e

f

g h i (^) j

k l m n o

Cork Institute of Technology

Bachelor of Science (Honours) in Software Development - Stage 3

Autumn 2007

Computer Science

(Time : 3 Hours)

Answer any four questions. Examiners : Mr. V. Ryan Dr. M. O Cinneide Mr. M. Donnelly

Question 1 a) Which of the following graphs are Hamiltonian (have a Hamilton Cycle) and explain why? i. the complete graphs K (^) n ii. the complete biparite graphs K (^) i,j iii. trees [7 Marks]

b) Using the four rules discussed in class for determining whether or not a graph has a Hamilton Cycle, determine whether the following graph a Hamilton Cycle or not. If it has a Hamilton Cycle, find one such cycle.

[8 Marks]

c) Explain how we deal with repeated roots in the solving of linear recurrence relations. [3 Marks]

d) Solve the following linear recurrence relation: h 0 = 0 h 1 = 2

h (^) n = 5h (^) n-1 + 9h (^) n-2 , n>1. Verify your answer by checking the value of h (^4) .. [7 Marks]

Question 2 a) Explain the following terms as they relate to graph theory: i. loop ii. distance iii. diameter of a graph iv. walk v. trail vi. path vii. cycle [7 Marks]

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

c) Describe the SUBSET-SUM Problem. [2 Marks]

d) Show that the SUBSET-SUM Problem is in the class NP. [3 Marks]

e) Explain what is meant by the problem SUBSET^ āˆ’^ SUM. [2 Marks]

f) Explain why SUBSET^ āˆ’^ SUM is probably not in the class NP. [3 Marks]

Question 4 a) Give an example of a planar graph, which has a drawing which is non-planar. [2 Marks] b) What is meant by two graphs being homeomorphic? [2 Marks]

c) 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]

d) State Euler's Formula, as it applies to a planar graph. [2 Marks]

e) What can you say about the degrees of the vertices of a graph which is loop-free, connected, and is planar. [3 Marks]

f) What is the definition of big-Oh? [3 Marks]

g) What is the complexity of the following algorithmic structures with respect to the problem size n. Assume that S is some operation in the order of O(1) and a is a constant greater than 1. Show all workings clearly.

(i) for ( i=1 ; i<=n ; i++ ) for ( j=1 ; j<=a ; j++ ) S; [2 Marks]

(ii) for ( i=1 ; i<=a ; i++ ) for ( j=1 ; j<=i ; j++ ) S; [3 Marks]

(iii) for ( i=1 ; i<=n ; i+=a ) S; [2 Marks]

A

H

F

G

C

D

B

E

Question 5 a) Virus X spreads by email in the following manner: The author of the virus launched it from his/her computer to 7 victims. It searches the victim’s address book for others that the person corresponds with, and automatically sends itself on to 7 of those people. We refer to the process of being sent to another victim and installing itself on the victim’s computer as an infection. These 7 infections take place in parallel. Assume that everybody has at least 7 entries in their address book. Assume that no person will be infected twice by this process. If it takes an average of 5 minutes for an infection, how long before 40,005 PCs are infected? Use a tree to model the problem, and use the results and/or algorithms developed in class relating to trees in arriving at a solution to the problems. State clearly any results that you use. [8 Marks]

b) Explain what is meant by a prefix code. [2 Marks]

c) Give an example of a prefix code as represented by a Huffman Tree. [2 Marks]

d) Why will a Huffman Tree with codes at the leaves as we used in class always yield a prefix code? [3 Marks]

e) What is the definition of NP-Complete? [3 Marks]

f) Consider the following statement ā€œIf A <=^ p^ B where B in NP , and A is NP-complete , then B is NP-complete also.ā€ Explain in detail why this is the case. [4 Marks]

g) List three well-known NP-Complete problems. [3 Marks]

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

d) 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 ]

APPENDIX

Refers to Question 6

Please detach and submit with your answer book.

NAME:

A Z

G

F

D

B E

A Z

G

F

D

B E

A Z

G

F

D

B E

NAME:

A Z

G

F

D

B E

A Z

G

F

D

B E

A Z

G

F

D

B E

NAME:

A Z

G

F

D

B E

A Z

G

F

D

B E

A Z

G

F

D

B E