All work must be your own. Turn in electronic format (PDF or MS Word) and any supporting programs (source code and test cases). Show your work in all the details for maximum score.
NOTE: No extensions or late submissions for anything.
(Q1) [15 pts.] What is the order of the following algorithm:
procedure Func1(m,n)
{
while (m > 0)
{
t = n mod k;
n = k;
k = t;
}
}
(Select the answer from the following options and prove your choice):
(Q2) [5 pts.] A graph with n nodes is connected, undirected, and acyclic. How many edges must it have? (Select the answer from the following options and prove your choice):
(Q3) [40 pts.] Given these methods:
public int math1( int n ) {
if (n <= 1) {
return 1;
} // if
else {
return ( 2 * n ) + math1( n-1 );
} // else
} // math1
METHOD math2:
public int math2( int n ) {
if (n <= 1) {
return 1;
} // if
else {
return n + math1( n ) * math2( n/2 );
} // else
} // math2
(a) Set up a recurrence relation for the running time of the method math1 as a function of n. Solve your recurrence relation to specify THETA bound of math1.
(b) Now set up a recurrence relation for the running time of the method math2 as a function of n. Solve your recurrence relation to specify the Big-O bound of math2.
HINT: When doing this, the call to math1 can be replaced by the equation that you found when solving the recurrence relation for math1 in part a) [see above].
(Q4) [10 pts.] Which Design Technique was used to produce Kruskal’s Algorithm? (Select the answer from the following options of Design Techniques and prove your choice):
(Q5) [30 pts.] Given a six vertex graph (see below):
NOTE: DO THIS BY HAND (using any simple drawing tool)! No need to write code.
ATTN: Submit your Final Exam Report in electronic format (PDF or MS Word) as an attachment to your email
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more
Recent Comments