Sabancı University
Faculty of Engineering and Natural Sciences
CS301 – Algorithms
Homework 3
Due: November 3, 2009 (17:40  Recitation @ FASS 1103)
PLEASE NOTE
:
•
Provide only the requested information and nothing more. Unreadable, unintelligible and
irrelevant answers will not be considered.
•
You can collaborate with your friends and discuss the solutions of the problems. However
you have to write down the solutions on your own.
•
Plagiarism will not be tolerated.
•
You don’t have to typeset your answers but feel free to do so if you want to.
•
Please hand in the hard copies of your answer sheets to TAs at the beginning of the recitation
hour on November 13, 2009.
Question 1)
Computing 2
n
a.
Design a recursive algorithm for computing 2
n
(for
n >
1) based on the following formula:
2
n
= 2
n

1
+ 2
n

1
, where 2
0
is known to be 1.
However, suppose that you are using a
funny programming language where no local variables can be defined and only the addition
operation is allowed.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '10
 .
 Algorithms, Addition, Recurrence relation

Click to edit the document details