Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. b) Since this decision tree uses <, =, and >, and must compare each pair of adjacent elements in the array, the lower bound is O(nlogn).
  2. c) Yes, it is a tight lower bound. Since all adjacent elements need to be compared, there is no way for it to happen any faster.
  3. 2. A).
  4. A) It is well known that problem Q has a tight lower bound of Omega(n logn).
  5. - Transform each element x of Q into a point (x,0) (Cost1 ∈ Omega(n logn)
  6. B) Find MST for these points.
  7. - Cost2 = Cost(P)
  8. C) Traverse MST to look for a zero-length edge
  9. - Cost3 ∈ Theta(n) because MST has n-1 edges.
  10. Cost(Q) = Cost1 + Cost2 + Cost3
  11. = Costreduction + Cost(P) where Costreduction ∈ Theta(n)
  12. B). Reasoning by contradiction: If P could be solved at a cost that is cheaper than Omega(n logn), Cost(P) ∈ o(n logn), therefore cost(Q) ∈ o(n logn). Therefore Cost(P) ∈ Omega(n logn)
  13. C. Yes, Omega(n logn) is a tight lower bound for P, since it is reducible from Q.
  14.  
  15. 4. a) It will have to read a “1” n times.
  16. b) The number of “0”s can change depending on the number of “1”s.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement