DAA August 9

Suggested Books: #

Thomas H Orman - DAA
Algorithm Design Manual

GCD Code:

def gcd(m,n):
	while n != 0 do:
		r = m mod n
		m = n
		n = r
	return m
def gcd(m,n):
	t =  min (m,n)
	while true:
		if m%t = 0:
			if n%t = 0:
				return t
		t = t - 1

General Approaches To Algorithm Design

  • Divide and Conquer
  • Greedy Method
  • Dynamic Programming
  • Basic Search and Traversal
  • Graph Theory
  • Linear Programming
  • Approximation Algorithm
  • NP Problem HW 9 Aug: Find the prime factors of a given number