Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could anyone explain time-complexity on 4.2 and 4.3? asteI OI SIOwer Suppose that some algorithm A has running time f (n) and that algorithm B

image text in transcribedCould anyone explain time-complexity on 4.2 and 4.3?

asteI OI SIOwer Suppose that some algorithm A has running time f (n) and that algorithm B has running time g(n), on all inputs of size n. Assume that f and g are functions N N+, and that limnoof(n) and limn009(n) are both infinity. Explain whether each statement in parts 2 and 3 below is true or false. Part 1 is already done for you 1. For some choice of g(n) with g(n) E S(f (n) log n): (a) A is faster than B on all sufficiently large inputs SOLUTION True. Choosing g(n) - f(n) ([log2 n] 1) satisfies the condition that g(n) 2(f (n) logn). For this choice, g(n) > f(n) for all n, and so B is slower than A on all inputs (b) A is slower than B on all sufficiently large inputs SOLUTION False. For all choices of g with g(n) e (f(n) logn), we have that g(n) > f(n) for sufficiently large n. So B is slower than A on all sufficiently large inputs This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. @0 For license purposes, the author is the University of British Columbia (c) A is faster than B on some inputs, and slower than B on other inputs SOLUTION True. Let nl 1 and f(na) > 1. Choose g(n-1 for n n2 . Then g(n) E (f(n) log n), g(n) > f(n) for all n > n2, and g(n)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions