This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: out without looking back at the notes for the answer. - linear search - binary search - bubble sort - insertion sort - selection sort Q3. Show that 2 n 2 + 4 +3 is O(n 2 ) Q4. Now show that the above complexity function is also (n 2 ) Q5. Solve the following recurrence relations and give the big O complexity of each. (a) T(1) = 1 for N = 1 T(N) = T(N-1) + N for N 2 (b) T(1) = 1 for N = 1 T(N) = T(N/2) + 1 for N 2 (c) T(1) = 0 for N = 1 T(N) = T(N/2) + N for N 2 (d) T(1) = 0 for N = 1 T(N) = 2T(N/2) + N for N 2...
View Full Document
- Spring '10