I have an array where i have some numbers. Now i want to sort even numbers in a separate array and odd numbers in a separate
Bitwise operators in Java
Bitwise operators are used to perform manipulation of individual bits of a number. They can be used with any of the integral types (char, short, int, etc). They are used when performing update and query operations of Binary indexed tree.
Bitwise And operation of 3 and 1
3 = 0011 , 1 = 0001
0011 'In Binary'
&0001 'In Binary'
________
0001 = 1 'In Decimal'
int[] array_sort = {91,1,5, 12, 3, 21, 8, 7, 19, 102, 201 };
Odd:[1, 3, 5, 7, 19, 21, 91, 201]
Even:[8, 12, 102]