tut1.pdf - SI 408 Data Structures Tutorial 1 1 Assume f g h N \u2192 R Show the following(a If f(n = \u0398(g(n then g(n = \u0398(f(n(b If f(n = O(g(n and g(n =

tut1.pdf - SI 408 Data Structures Tutorial 1 1 Assume f g h...

This preview shows page 1 out of 1 page.

SI 408: Data Structures Tutorial 1 1. Assumef, g, h:N+R. Show the following:(a) Iff(n) = Θ(g(n)), theng(n) = Θ(f(n)).(b) Iff(n) =O(g(n)) andg(n) =O(h(n)), thenf(n) =O(h(n)). Similarly forOreplacedby Ω or Θ.(c) Iff1, g1, f2, g2are functions such thatf1O(f2) andg1O(g2), then show thatf1+f2O(g1+g2) andf1·f2O(g1·g2).Show by example that the following can befalse:f1-f2O(g1-g2).2. Show that for any functionsf, g:NR.Let the functionh:NRbe defined byh(n) = max{f(n), g(n)}. Show thath(n) = Θ(f(n)+g(n)). Also leth0(n) = min{f(n), g(n)}.Show that there are functions
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

  • Winter '16
  • Archana Chauhan
  • Big O notation, R. Show, log n, Loga N

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture