algorithm - Communication complexity -
algorithm - Communication complexity -
i sending strings server , want calculate complexity.
for each string s
sending prefices of s
. hence start sending 1 character, 2 characters, 3 ... until sending |s|
characters.
what communication complexity here? have said o(|s|²)
not certain.
also in algorithm sending each character in s
fix-sized amount of data, let's 100 characters. sending |s| * 100
characters. should in o(|s|)
right? 1 worse? short s
first algorithm better, or off here?
please, right me if wrong.
sending 1 character, 2 characters, 3 ... until sending |s| characters.
when send first character, remaining charcters (|s|-1) or starting 1 time again everytime |s|
for first possibility:let's |s|=n
1+2+...+n=n(n-1)/2
the complexity in case is: o(|s|^2)
for sec possibility: 1+2+...+a=|s|the complexity in case is: o(|s|)
linear-time complexity time better, check tutorial more info complexity time
algorithm complexity-theory time-complexity
Comments
Post a Comment