1.
#include<cmath>
int Tfunction(int a)
cfw_
if (a=0)
cfw_
return 0;
else
cfw_
return (Tfunction(a-1)+1);
int Qfunction(int a)
cfw_
if (a=0)
cfw_
return 0;
else
cfw_
return (Qfunction(a-1)+a);
int Rfunction(int a)
cfw_
if(a=0)
cfw_
return 0;
else
c
Rivest Shamir Adlemani-Diffie Hellman
Two large prime numbers
G p,q
N=p*q
e relatively prime to (p-1)(q-1)
x^e mod N-modexp function
Decode this message:
d=e^-1 mod (p-1)(q-1)
p=5, q=11e=3
5^-1 mod 72
5x+by=1 mod 72
Divide and Conquer:
1. Merge Sort
2. Bi
Intro to Algorithms 9/2/10
1. Big Oh, Big Omega, and Big Theta Notation
2/ Examples
3. Algorithm Analysis
4. Multiplication, division, modular addition, euclidean algorithm
Big O Defn: f(n)=O(g(n)
if f(n)<=c*g(n) for some c and for n>=n0
Big O is the uppe
Intro to Algorithms
http:/www.cs.rpi.edu/~moorthy/Courses/CSCI2300/
DSA aka Intro to Algorithms
1. Design of Algorithms
2. Analysis of Algorithms
-How long does the algorithm take? (run time)
-Hor much storage does the algorithm need
What is the best poss
Communication, Language, etc.
Ideas:
-Ideas are species
-They live, they reproduce, they mutate, they evolve
-Fit ideas stick around, bad ideas die out
-Like any species, ideas fight for survival
Humans and Ideas
-What makes humans so special is that we a