

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


(This is a WRITTEN HW.)
G(0) = 1 G(1) = 2 G(n) = 5 G(n โ 1) + 6G(n โ 2)
Find G(n) in closed form. Show all work. (If you do not know how to solve equations of this type then look it up.)
F (0) = 1 F (1) = 1 F (n) = F (n โ 1) + F (n โ 2)
Show by a combinatorial proof (not by induction or algebra) that, for all n, m โฅ 0,
F (m + n) = F (m)F (n) + F (m โ 1)F (n โ 1).
(a) INSERT can be performed on S (b) REMOVETOPTHIRD, which removes the top (based on the ordering) third of the ele- ments from S, can be performed on S. (c) m operations can be done in O(m) steps. (Prove this.)
You may use well established algorithms as subroutines without proving their complexity.
TURN OVER- THERE IS A PAGE 2 WITH TWO MORE PROBLEMS
We showed that n operations take O(n log n) time using an argument about counting the number of times an element was involved in a union. PROVE that n operations take O(n log n) time using a potential argument.