{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Midterm review problems

Midterm review problems - 3 Is the algorithm you described...

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

View Full Document Right Arrow Icon
Big-O Analysis - Finding two numbers in an array of size N that sum to a specific value Given a list of numbers in an array, find two numbers in the array that sum to a particular value. For example, let’s say I have an array of numbers as so, array = {1, 2, 5, 3, 10, 7, 3, 6, 11, 8, 9, 6, 6, 7, 9, 12}, and the number I am interested in is number = 14 1. How would you find two such numbers? Please describe your algorithm in pseudo code. 2. Given the size of the problem, N, representing number of numbers in the array of numbers. What is the Big-O of the algorithm you described in part 1?
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 3. Is the algorithm you described in part 1 the fastest? If not, what is the Big-O of the fastest algorithm? Modular Exponentiation Prove ± ²³´µ²¶ · ¸ ²³´µ²¶¹ ± ²³´µ²¶ Modular Inverse Find the modulo inverse of 103 in base 4 (Hint: 103 is in base 4) Key Generation Given two prime numbers, 61 and 53 1. Find public key 2. Let e = 17, encrypt a message m, m = 3 Test for Prime Number Use Fermat’s little theorem to test if 23 is a prime number (Hint: avoid rounding)...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online