// given an array of 1 and 0, sort the array so that all 0s are on the left and all 1s are on the right // solve using 2 pointers in O(n) time and O(1) space // solve using a function in java import java.util.Arrays; import java.util.Scanner; class TwoPointersZeroAndOne{ public static void main(String[] args){ System.out.println("Enter the number of elements in the array"); Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int[] arr = new int[n]; System.out.println("Enter the elements of the array"); for(int i=0; i