Pascal classic algorithm explanation - longest increasing subsequence

From , 5 Years ago, written in Delphi (Object Pascal), viewed 198 times.
URL https://pastebin.vip/view/230e4100
  1.     S[1]:=1;                   {以第一个元素为末元素的递增序列长度肯定是1}
  2.     For i←2 to n do
  3.       For j←1 to i-1 do
  4.         Begin
  5.           搜索A[i]前面比A[i]小的数A[j],得到对应的S[j];
  6.           S[i]←max{S[j]}+1;
  7.         End;
  8.     Write(max{S[i]});
  9.  
  10.  
  11. //delphi/7196

Reply to "Pascal classic algorithm explanation - longest increasing subsequence"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website