Skip to main content
2 of 2
added 28 characters in body; edited tags
xskxzr
  • 7.6k
  • 5
  • 23
  • 47

How to get Algorithm complexty based on another 2 algorithms?

I had quiz last week and it says: suppose algorithms $A_1$ and $A_2$ have worst-case time bound $p$ and $q$, respectively. Suppose algorithm $A_3$ consists of applying $A_2$ to the output of $A_1$. (The input for $A_3$ is the input for $A_1$.) Give a worst-case time bound for $A_3$.

How could I calculate the worst case based on the given info?