伪代码:
input:Num[n]
Max[1..n]=1
for i<-2 to n
for j<-1 to i-1
if Num[i]<Num[j] and Max[i]<=Max[j] then Max[i]<-Max[j]+1
Output(Maxam(Max[1..n]))
状态转移方程:max[i]=max{max[j]}+1,j<i;
伪代码:
input:Num[n]
Max[1..n]=1
for i<-2 to n
for j<-1 to i-1
if Num[i]<Num[j] and Max[i]<=Max[j] then Max[i]<-Max[j]+1
Output(Maxam(Max[1..n]))
状态转移方程:max[i]=max{max[j]}+1,j<i;