in Programming in C
956 views
0 votes
0 votes

 

in Programming in C
by
956 views

4 Comments

@Magma inside we have two loops which have O(n+logn)...

and 2 outside loop runs for O(n)

so overall = 0(n(n+logn)) = O(n2) ?

.

check once ! i have cross checked maybe i missed somewhere...

 

1
1
Yeah you're right

I did silly mistake :p
0
0
What's the answer ? 200 ?
0
0

1 Answer

0 votes
0 votes

I am getting 100 :( for Bound=1 loop is running 1*(n+logn) times, for Bound=2 its running 2*(n+logn) times and so on ..

So, the series i am getting is n+2n+4n+8n+... which comes out to be O(n).

kindly correct me if something wrong @srestha@Arjun@Habibkhan

1 comment

0
0

Related questions