public static void segregateEvenAndOdd(int[] input) {
        int left = 0;
        int right = input.length -1;

        while(left<right){
            while(left<right && input[left] %2 == 0){
                left++;
            }

            while(left<right && input[right] %2 ==1) {
                right --;
            }

            if(left <right){
                int temp = input[left];
                input[left] = input[right];
                input[right] = temp;
                left ++;
                right --;
            }

        }

    }