World's most popular travel blog for travel bloggers.

Running time of an algorithm containing binary elements for cryptography

, , No Comments
Problem Detail: 

Hey guys sorry I'm new to cs and I'm trying to find the running time of algorithms... could you tell me about the algo given how much time is needed in terms of complexity? The actual algo I created is the same as below but the sum must be more or equal to 2^(n-2).Thank you![enter image description here]1

Asked By : Nick Parisis
Answered By : p77u4n M.S.O LAB HUST

We take only one step for computing each $2^ix_i$ (By using left-shift operation we can compute $2^i$ in constant time). So the complexity of Algorithm $\mathcal{A}$ is $\mathcal{O}(n)$.

I suspect you used loop for computing $2^i$, and this incurred your bad result.

PS : sorry for my bad english

Best Answer from StackOverflow

Question Source :

3200 people like this

 Download Related Notes/Documents


Post a Comment

Let us know your responses and feedback