[xquery-talk] longest sequence of monotonically increasing
integers
Howard Katz
howardk at fatdog.com
Fri Mar 3 07:02:42 PST 2006
You're right: somehow the qualifier "consecutive" got dropped from my email
between the first draft and the second.
Your initial guess as to what I meant was absolutely correct. Maybe you and
Peter should share the all-important role on this list of being the person
who always guesses correctly what question the original poster meant to ask,
and translates it for the rest of us ... :-)
Thanks to both of you for your replies btw.
Howard
> -----Original Message-----
> From: Michael Kay [mailto:mhk at mhk.me.uk]
> Sent: March 3, 2006 2:09 AM
> To: 'Howard Katz'; talk at xquery.com
> Subject: RE: [xquery-talk] longest sequence of monotonically
> increasing integers
>
> Returning to this, I'm not sure if I misread the requirement
> or if you
> miswrote it. Surely the sequence
>
> ( 1945, 1951, 1952, 1952, 1953, 1961, 1962, 1998 )
>
> is monotonically increasing and therefore the longest monotonically
> increasing subsequence has length 8?
>
> Michael Kay
> http://www.saxonica.com/
>
> > -----Original Message-----
> > From: talk-bounces at xquery.com
> > [mailto:talk-bounces at xquery.com] On Behalf Of Howard Katz
> > Sent: 03 March 2006 02:29
> > To: talk at xquery.com
> > Subject: [xquery-talk] longest sequence of monotonically
> > increasing integers
> >
> > 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
> >
> > _______________________________________________
> > talk at xquery.com
> > http://xquery.com/mailman/listinfo/talk
> >
>
More information about the talk
mailing list