Chapter 4
4.1-6 Show T (n) = 2T ( n) + 1. Follow the method on p.57 for changing variables. Let n = 2k . Then Let S(m) = T (2k ). Then S(m) = 2S(m/2) + 1. Solve this using the Master Theorem (case 1 applies) or iteation: m S(m) = 2S(m/2) + 1 = 2(2S(m/4)
FALL 2002
CS5329
MIDTERM
C. HAZLEWOOD
1
Write your name on this paper. Answer all questions on this paper. Write on the back if you need more space. 1. Circle a location for each class day: a. Location for Mon return SM MITC Location for Wed return : SM M
FALL 2001
CS5329
MIDTERM
C. HAZLEWOOD
Write your name on this paper. Answer all questions on this paper. Write on the back if you need more space. 1. Asymptotic Notation. (a) Show 3n2 - 10n + 6 is (n). (b) Suppose f , g and h are asymptotically non-negati
Chapter 9 9.1-1 Conduct a tournament to find the smallest of n numbers. Compare numbers in pairs. The smaller number in each pair 'wins'. (The larger cannot be the min.) Now compare these winning numbers in pairs. Repeat until one number is left. The tour
SPRING 2003 1. Quickies.
CS5329
FINAL EXAM
C. HAZLEWOOD
(a) Asymptotic Notation. i. The average-case complexity of Matrix-Chain, is (n3 ). If the problem size is doubled, what happens to the run-time? ii. Given a choice of algorithms A, B, and C, with res
Chapter 23 23.2-4 Kruskal's algorithm requires O(E lg E) time: O(V ) to initialize O(E lg E) to sort the edges by weight O(E(E, V ) to process the edges If all edge weights are integers in the range 1.|V |, we can use counting sort on the edges to reduce
Chapter 3
3.1-1 If f and g are asymptotically non-negative, show max(f (n), g(n) = (f (n) + g(n). Let h(n) = f (n) g(n)
if f (n) g(n) if g(n) f (n)
Choose n0 so f (n) 0 and g(n) 0 for n n0 . Then, for n n0 , f (n) + g(n) h(n) 0. Using c = 1 in the definit
CMPT 765 LECTURE NOTES
Taken by: Hoda Akbari
Routers and Routing Algorithms
Router: a network device working in the network layer; it receives packets, puts them in a queue and
dispatches the packets to the links toward their destinations. To do this, it