I have a network which includes $L$ blocks ($B_1,\cdots,B_L$) connected one after the other. I have an algorithm having computational complexity $\mathcal{O}(N)$ which runs in each block individually.

I first run the algorithm on $B_1$ and get the output. Based on that output, I select the second data set in $B_2$. Then run the same algorithm on $B_2$ and get the output, and so on till $B_L$. The important thing is that the present data set depends on the previous block output.

Now I want to know the overall system complexity. I guess it is $\mathcal{O}(LN)$. Is that right?

  • $O(n)$ means "linear in the size of the data it's running on". Is the data selected within each block also $O(n)$ in size? – Draconis Jul 11 at 3:01
  • yes, same size of data sets. – Frey Jul 11 at 3:30

To summarize what you're saying:

  • You have an algorithm that runs in $O(n)$.
  • You're running it on $L$ different blocks, sequentially (no parallelism).
  • Every block has size $N$.

In this case, the total running time is indeed $O(LN)$.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.