# Find the computational complexity of a concatenated system

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 '18 at 3:01
• yes, same size of data sets. – Frey Jul 11 '18 at 3:30

• 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)$.