[SOLVED] Java algorithm Imperial College London Department of Computing

$25

File Name: Java_algorithm_Imperial_College_London__Department_of_Computing.zip
File Size: 593.46 KB

5/5 - (1 vote)

Imperial College London Department of Computing

MSc in Computing Science

580: Algorithms

Tutorial 2

1. (Part of a 2015 exam question.)

(a) Using either Java or pseudocode, write a recursive procedure Pow(x,N) to compute
xN , where N is a positive integer. Use a divide and conquer strategy. Hint:

xN = xN/2 xN/2 for even N
xN = x(N1)/2 x(N1)/2 x for odd N.

(b) Write recurrence expressions for the time complexity T (N) of your Pow procedure
in the following cases:

T (N) =

{
, if 0 < N c, if N > c

What is c?

(c) Solve your expressions for T (N) using the master method. Show each step.

1

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] Java algorithm Imperial College London Department of Computing
$25