Ardianta_Pargo

Psude Code Dynamic Prograramming to finding longest path in

Oct 18th, 2014
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. for i=0 to n-1
  2. LS[i]=1
  3. for j=0 to i-1
  4. if (a[i] > a[j] and LS[i]<LS[j])
  5. LS[i] = LS[j]+1
  6. for i=0 to n-1
  7. if (largest < LS[i])
  8. largest = LS[i]
  9.  
  10. sumber: http://www.codechef.com/wiki/tutorial-dynamic-programming
Advertisement
Add Comment
Please, Sign In to add comment