PyNotes
261 subscribers
125 photos
7 videos
1 file
60 links
**Code is communication**
admin: @Xojarbu
https://t.me/solutions_py for problem solutions
Download Telegram
#SubArray, #SubSequence, #SubSet

Comparing SubArray SubSequence and SubSet

Subarray
is contiguous sequence in an array.
e.g we have an array of {1, 2, 3, 4}
subarray can be: {1,2,3}, {2,3,4}, {1,2} etc.

A subsequence doesn't need to be contiguous, but maintains order
e.g subsequence can be: {1, 2, 4} {2, 4} {1, 3, 4} etc.

A subset doesn’t need to maintain order and has non-contiguous behavior.
e.g subset can be: {4, 1,3} {3, 1, 2 } etc.