Write a recursive, boolean -valued method named search that accepts an integer array , the number of elements in the array, and an integer (in that order), and returns whether the integer is present as an element in the array.

Write a recursive, boolean -valued  method named search that accepts an integer  array , the number of elements in the array, and an integer  (in that order), and returns whether the integer is present as an element in the array.

LANGUAGE: JAVA

CHALLENGE:

Write a recursive, boolean -valued method named search that accepts an integer array , the number of elements in the array, and an integer (in that order), and returns whether the integer is present as an element in the array. Searching for a particular value in an array can be performed in the following recursive manner:
• If the array has no elements , the value is not there.
• Compare the first element of the array to the value , if they’re equal , the value is there; other search for the value in the rest of the array .

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days – Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level