Subarray / Substring / Subsequence
SubsequencePermalink
Definition: Let
- E.g., the prime numbers
are a subsequence of the natural numbers .
描述性的定义: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.
- E.g.,
could be a subsequence of , but not a subarray
SubarrayPermalink
A subarray is a contiguous/consecutive subsequence of an array.
By contiguous/consecutive, 我觉得它的意思是 sequence of indices
SubstringPermalink
A substring is exactly the same thing as a subarray but in the context of strings.
Comments