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
1 Posted Topic
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.
The End.
mbundgaard