@@ -0,0 +1,867 @@
+package ds.arrays;%0A%0A/**%0A * %0A * In a given array, all elements occur even number of times except one number. can you find that one number in array ?%0A * %0A * @author bboggaramrama%0A *%0A */%0Apublic class OddOccurence %7B%0A%0A%09public static void main(String args%5B%5D) %7B%0A%09%09OddOccurence driver = new OddOccurence();%0A/*%09%09%0A * Output :%0A        The odd element is :2%0A%09%09The odd element is :3%0A%09%09The odd element is :4%0A%09%09The odd element is :7%0A*/%0A%09%09driver.findOddOccurence(new int%5B%5D %7B1,1,2%7D);%0A%09%09driver.findOddOccurence(new int%5B%5D %7B1,1,2,2,2,2,3%7D);%0A%09%09driver.findOddOccurence(new int%5B%5D %7B1,1,2,4,5,2,5%7D);%0A%09%09driver.findOddOccurence(new int%5B%5D %7B6,6,7,7,7,7,7%7D);%0A%0A%09%7D%0A%09%0A%09public void findOddOccurence(int%5B%5D a)%7B%0A%09%09%0A%09%09int res = 0;%0A%09%09// METHOD :  XOR operation (Beauty of XOR, You see :) )%0A%09%09for(int i=0;i%3Ca.length;i++) %7B%0A%09%09%09res = res %5E a%5Bi%5D;%0A%09%09%7D%0A%09%09System.out.println(%22The odd element is :%22 + res);%0A%09%7D%0A%09%0A%7D%0A

Find an element that occurs odd number of times in a given array