java - Recursive function to check whether sub-array -
i trying write recursive function check whether 1 array contained in second array (my example sub-array) , returns true or false.
for example: [d, e] contained in [a, b, c, d, e, f]
.
i know how check without recursion (using loops), can not think of solution using recursion.
you can use hashing store elements of large array in hash table , check whether each element of sub array there in hash table or not, if elements found subarray.
Comments
Post a Comment