Suppose an array consist of 3 elements:
A=[1,2,3]
What I want to know is that, is it possible to add each element of array with each other such that time complexity is O(n)?. Result should have
b=[(1+1),(1+2),(1+3),(2+2),(2+3),(3+3)]
No, that's O(n^2).
Now let's see someone prove me wrong ... even better, someone has proven my assertion right -- see the comments below.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With