Question: int sum = 0 ; for ( int i = N; i > 0 ; i - - ) { if ( i % 2
int sum ;
forint i N; i ; i
ifi
sum ;
Careful the if statement should be part of the BigO and will be different from sum For sum consider when the if statement will be true and how many times that will occur for a given positive integer N
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
