HashTables

4 methods: hash, insert, find, remove

Dynamic Programming

Recursion

def fib(n):
	if n == 1 or n == 2:
		result = 1
	else:
		result = fib(n-1) + fib(n-2)
	return result

# O(2^n)

Memoization

def fib(n, memo):
	if memo[n] != null:
		return memo[n]
	if n == 1 or n == 2:
		result = 1
	else:
		result = fib(n-1) + fib(n-2)
	memo[n] = result
	return result
		
# complexity: T(n) = # calls * t <= (2n + 1) * O(1)
# = O(n)
# t = time to execute call

Bottom-Up

def fib_bottomup(n):
	if n == 1 or n == 2:
		return 1
	bottom_up = new int[n+1]
	bottom_up[1] = 1
	bottom_up[2] = 1
	for i from 3 upto n:
		bottom_up[i] = bottom_up[i-1] + bottom_up[i-2]
	return bottom_up[i]
##O(n)

Graphs