无序数组的最长递增子序列

package offer;


public class Main {


public static void main(String[] args) {
// TODO Auto-generated method stub

}


public int findLongest(int[] A, int n) {
       // write code here
int max = 0;
int dp[] = new int [n];
dp[0] = 1;
for(int i = 0;i
for(int j = 0;j if(A[j]dp[i]) {
dp[i] = dp[j]+1;
max = max>dp[i]?max:dp[i];
}
}
}
return max;
   }
}

你可能感兴趣的:(无序数组的最长递增子序列)