Monday, December 9, 2013

[Fab Interview] Segregate 0s and 1s

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}

1 comment: