I have gone through Asymptotic Notations. But I didn't see any clear visual representation and sample examples for the Asymptotic Notations.Anybody help me to get the clear representation for the same.
I have attached the same program herewith. Kindly tell me what notation it is following and how to find out what order it is using(O(n), nlogn or O(n2) etc). I have checked the time taken for the program is by System.currentTimeMillis() method.
The sample program is
public class ArrayPrblem {
public static void main(String[] args){
int arr[] = {10,2,11,4,3,7,6};
int brr[] = {11,3,12,4,7,9,12};
for(int i=0;i<arr.length;i++){
for(int j=0;j<brr.length;j++){
if(i<j && arr[i] > brr[j]){
System.out.println(""+(arr[i]+","+brr[j]));
}
}
}
System.out.println(+System.currentTimeMillis());
}
}
Kindly suggest me how to write a good optimized program by using this Asymptotic Notations.
Thanks in Advance