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
- LongestOrderedSequence returns the longest common sequence, formed by contiguous or disjoint elements, with disjoint pieces concatenated.
- LongestOrderedSequence works on strings as well as lists.
- If there are several ordered sequences of the same length, LongestOrderedSequence returns the one that begins earliest in list.
- For strings, setting the option IgnoreCase->True makes LongestOrderedSequence treat lowercase and uppercase letters as equivalent, and return the form of sequence that occurs in s.
Examples
open allclose allBasic Examples (4)
Options (1)
IgnoreCase (1)
By default, LongestOrderedSequence distinguishes lower case and upper case:
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