Subsequence

In mathematics, a subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements. For example, the sequence




A
,
B
,
D



{\displaystyle \langle A,B,D\rangle }
is a subsequence of




A
,
B
,
C
,
D
,
E
,
F



{\displaystyle \langle A,B,C,D,E,F\rangle }
obtained after removal of elements



C


{\displaystyle C}
,



E


{\displaystyle E}
, and



F


{\displaystyle F}
. The relation of one sequence being the subsequence of another is a preorder.
Subsequences can contain consecutive elements which were not consecutive in the original sequence. A subsequence which consists of a consecutive run of elements from the original sequence, such as




B
,
C
,
D



{\displaystyle \langle B,C,D\rangle }
from




A
,
B
,
C
,
D
,
E
,
F



{\displaystyle \langle A,B,C,D,E,F\rangle }
, is a substring. The substring is a refinement of the subsequence.
The list of all subsequences for the word "apple" would be "a", "ap", "al", "ae", "app", "apl", "ape", "ale", "appl", "appe", "aple", "apple", "p", "pp", "pl", "pe", "ppl", "ppe", "ple", "pple", "l", "le", "e", "" (empty string).

View More On Wikipedia.org
  • 56

    Greg Bernhardt

    A PF Singularity From USA
    • Messages
      19,443
    • Media
      227
    • Reaction score
      10,021
    • Points
      1,237
  • 2

    CGandC

    A PF Molecule
    • Messages
      326
    • Reaction score
      34
    • Points
      73
  • 2

    Hall

    A PF Atom
    • Messages
      351
    • Reaction score
      87
    • Points
      38
  • 1

    Maddiefayee

    A PF Quark
    • Messages
      5
    • Reaction score
      0
    • Points
      4
  • Back
    Top