Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~78 People Reached
Favorite Forums
Member Avatar for Pnlakshmicse

Hi.. Can you please explain how to calculate the time complexity for the code given below.. int flag,temp; do { flag=0; for(int j=0;j<n;j++) { if((j+1)==n) continue; if(a[j]>a[j+1]){ flag=1; temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; } } }while(flag==1);

Member Avatar for Rashakil Fol
0
78