I am unclear about the definition of a sub array. Does it mean a contiguous list of indexes , such as a[i..j] or can it be non contiguous, such as a[0], a[5],a[6]
Definition of subarray
arrays
Related Topic
- Javascript – Sort array of objects by string property value
- Ruby – What does %w(array) mean
- Javascript – Get all unique values in a JavaScript array (remove duplicates)
- Java – Converting array to list in Java
- Java – How to create a sub array from another array in Java
- Javascript – How to check if an object is an array?
- Bash – How to split a string into an array in Bash
- Javascript – How to get distinct values from an array of objects in JavaScript
Best Answer
I think the subarray means the array in which the contiguousness is based on the index . for example lets take an example
2 3 1 3 1 (index are 0,1,2,3,4 respectively )
so subarray is 2,3,1 3 (index 0,1,2,3) But (1,2 1) (index 2,0,4) cannot be a subarray coz the indexes are non-contiguous ..
Hope its helpfull ;)