Given an array of 0s and 1s in random order. Segregate 0s on the left side and 1s on the right side.
Traverse the array only once.
Input Array: {0,1,0,1,1,1}
Output Array: {0,0,1,1,1,1}
Traverse the array only once.
Input Array: {0,1,0,1,1,1}
Output Array: {0,0,1,1,1,1}
http://ideone.com/W9hAWh
ReplyDelete