# Subsequence Vs Substring Vs Subarray

**Substring 👍**

A substring is a contiguous(continuous) sequence of characters present within a string. It is a string present inside a string.  
For instance, the substrings of the string “tree” would be:   
‘t,’ ‘r,’ ‘e,’ ‘tr,’ ‘tre,’ ‘tree,’ ‘re,’ ‘ree,’ ‘ee’ and ‘’

* We can use single ‘ ’ or double “ ” quotes to denote substring.
    
* The entire string is a substring of itself.
    
* An empty string is also a substring of the given string.
    

**Sub-array 👍**  
We all know that an array is a contiguous memory block.  
So a subarray is a contiguous sequence of elements within an array. An empty array is also a subarray of an array.   
  
Arrays can be denoted by curly brackets {} or square brackets \[\].  
  
The example below gives a clear view of the subarrays of an array:  
int array\[ \] = {1, 5, 4};  
Therefore, subarrays for the array {1,5,4} are {1}, {1,5}, {1,5,4}, {5}, {5,4}, {4} and {}

**Sequence 👍**  
A Sequence can be thought of as a list of elements with a particular order.

For example, \[A, B, C, D, E, F\] is a sequence or \[1,4,3,2,1,5\] =&gt; While the elements in this sequence are of different types (numbers and letters), they are presented in a specific order, separated by commas, which makes it a sequence.

**Subsequence 👍**

A subsequence is a sequence that can be derived from another sequence of elements without changing the order of the remaining elements.

For example: {A, B, D} is one of the subsequences of the sequence {A, B, C, D, E} obtained after removing {C} and {E}.  
Parties: Subsequence and Longest Common Subsequence (LCS) [https://www.youtube.com/watch?v=VbcDFmHkuoA](https://www.youtube.com/watch?v=VbcDFmHkuoA)
