Back to the 2022 paper

Module 1: Introduction

20222m

An algorithm is made up of two independent time complexities f(n)f(n) and g(n)g(n). Then the complexities of the algorithm is in the order of
(i) f(n)×g(n)f(n) \times g(n)
(ii) max⁡{f(n),g(n)}\max \{ f(n), g(n) \}
(iii) min⁡{f(n),g(n)}\min \{ f(n), g(n) \}
(iv) f(n)+g(n)f(n) + g(n)

Worked SolutionAI Assisted

Answer: (ii) max{ f(n), g(n)} (which equals (iv) f+g asymptotically)

If algorithm has two independent parts sequentially, T = f+g = Θ(max). Sum asymptotically dominated by max. Both (ii) and (iv) are correct; exam expects (ii) max as simplified.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.