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
Ranked #107.69K
~959 People Reached
Favorite Forums
Favorite Tags
c++ x 1

1 Posted Topic

Member Avatar for garu525

This will not work in general. Counter-example: (2, 0, 1, 3, 4) Your algorithm gets stuck in a cycle in the first three elements, and, as a consequence, you will not traverse the entire array. EDIT: STRIKE THAT. I MISREAD YOUR CODE AS DOING THE INVERTING IN-PLACE.

Member Avatar for mbundgaard
0
959

The End.