LongestOrderedSequence

LongestOrderedSequence[list]

finds the longest ordered sequence of contiguous or disjoint elements in list.

LongestOrderedSequence[list,p]

finds the longest ordered sequence using the ordering function p.

Details and Options

Examples

open allclose all

Basic Examples  (4)

Find the longest ordered substring, in this case formed by contiguous characters:

Find the longest ordered sequence of elements in a list:

Find the longest strictly ordered sequence of elements in a list:

Find the longest decreasing sequence of elements in a list:

Scope  (2)

Act on strings:

Act on lists of expressions:

Options  (1)

IgnoreCase  (1)

By default, LongestOrderedSequence distinguishes lower case and upper case:

Ignore case:

Applications  (1)

Find the longest ascending sequence of characters in a text:

Neat Examples  (1)

Find the distribution of lengths of longest ordered sequences in random sequences:

Wolfram Research (2015), LongestOrderedSequence, Wolfram Language function, https://reference.wolfram.com/language/ref/LongestOrderedSequence.html.

Text

Wolfram Research (2015), LongestOrderedSequence, Wolfram Language function, https://reference.wolfram.com/language/ref/LongestOrderedSequence.html.

CMS

Wolfram Language. 2015. "LongestOrderedSequence." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LongestOrderedSequence.html.

APA

Wolfram Language. (2015). LongestOrderedSequence. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LongestOrderedSequence.html

BibTeX

@misc{reference.wolfram_2023_longestorderedsequence, author="Wolfram Research", title="{LongestOrderedSequence}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/LongestOrderedSequence.html}", note=[Accessed: 19-April-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_longestorderedsequence, organization={Wolfram Research}, title={LongestOrderedSequence}, year={2015}, url={https://reference.wolfram.com/language/ref/LongestOrderedSequence.html}, note=[Accessed: 19-April-2024 ]}