Assignment_01 - (a Show that X 62 can be computed with only eight multiplications(b Write the fast exponentiation routine without recursion in Java

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CS1102S Data Structures and Algorithms Assignment 01: Algorithm Analysis Submission on A-4 sheets (if more than one sheet, please staple), before 6pm on Wednesday, 27/1, to lecturer’s oFce, COM1, #03-28. (If the door is closed, slip your solution under the door.) 1. Exercise 2.1 on page 50: Order the following functions by growth rate: N , N , N 1 . 5 , N 2 , N log N , N log log N , N log 2 N , N log( N 2 ), 2 /N , 2 N , 2 N/ 2 , 37, N 2 log N , N 3 . Indicate which functions grow at the same rate and show why this is the case. 2. Excercises 2.22–2.24, pages 53-54:
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (a) Show that X 62 can be computed with only eight multiplications. (b) Write the fast exponentiation routine without recursion in Java. Sub-mit your solution on paper, and be ready to explain it during tuto-rials. You may try to implement the algorithm in Java (optional). (c) Give a precise count on the number of multipications used by the fast exponentiation routine in the textbook. (Hint: Consider the binary representation of N .) 1...
View Full Document

This note was uploaded on 06/09/2011 for the course CS 11025 taught by Professor Nil during the Spring '11 term at National University of Singapore.

Ask a homework question - tutors are online