[xquery-talk] longest sequence of monotonically increasing integers

Howard Katz howardk at fatdog.com
Thu Mar 2 18:28:42 PST 2006


Anybody have a nice method of finding the length of the longest
monotonically increasing subsequence in a sequence of integers? For example
given

     ( 1945, 1951, 1952, 1952, 1953, 1961, 1962, 1998 )

I need to be able to derive "3" for the run ( 1951, 1952, 1953 ). The double
entry for "1952" can be ignored.

TIA,
Howard



More information about the talk mailing list