ok i try first....then for the bubble sort i change to collection sort..it abit hard for me to implement the bubble sort...
--- Update ---
In the code even and odd are both variables of type List<Integer>. Change them to int arrays ( int[] ) or convert them to int arrays for the method call
List<Integer> odd = new ArrayList<Integer>();
List<Integer> even = new ArrayList<Integer>();
System.out.println("Linear Search Index : " + linearSearch.searchElementLinear(odd, toSearch));
System.out.println("Binary Search Index : " + binarySearch.searchElementBinary(even, toSearch));
--- Update ---
this what i comeout...
int odd1[] = {11, 13, 15, 21, 23, 25, 31, 33, 35, 41};
int even1[] = {10, 12, 14, 20, 22, 24, 30, 32, 34, 40};
int toSearch = 31;
int toSearch2 =32;
System.out.println("Linear Search Index : " + linearSearch.searchElementLinear(odd1, toSearch));
System.out.println("Binary Search Index : " + binarySearch.searchElementBinary(even1, toSearch2));
--- Update ---
the output..
Even number :[10, 12, 14, 20, 22, 24, 30, 32, 34, 40]
Odd number :[11, 13, 15, 21, 23, 25, 31, 33, 35, 41]
Linear Search Index : 6
Binary Search Index : 7