CSC 225 Midterm 1 Flashcards
What is a permutation?
Number of possible linear combinations where we count all different orderings of elements
Permutation Formula
n!/(n-r)!
What is a combination?
Number of possible linear combinations where we dont count separate orderings of elements.
Combination Formula
n!/[k!(n-k)!]
Binomial Formula
Formula:
What is the Pigeonhole Principle
If m pigeons occupy n pigeonholes then and m > n, then at least 1 pigeonhole has 2 pigeons in it.
simplify
simplify
simplify
simplify
memorize logarithm bullshit
Formal Definition of Big - Oh
let f: N+ -> R and g: N+ -> R
f(n) is O(g(n)) IFF there exists a constant c > 0 and n_o > 0 such that
f(n) <= c g(n) for all n > n_o
[f(n) curve must fit under cg(n) curve]
What is Stirlings Formula?
(approx for n!)
How does a stack work?
Stacks follow a LIFO principle.
What methods does stack have
push
pop
isEmpty
top
size