Skip to content

Latest commit

 

History

History
11 lines (7 loc) · 555 Bytes

RECURSIVE_LINEAR_SEARCH.md

File metadata and controls

11 lines (7 loc) · 555 Bytes

Recursive Linear Search

Modify Linear Search to use recursive method recursiveLinearSearch to perform a linear search of the array. The method should receive the search key and starting index as arguments. If the search key is found, return its index in the array; otherwise, return –1. Each call to the recursive method should check one index in the array.

Big O of the Recursive Linear Search

The recursive linear search algorithm runs in O(n) time.