Question: Java, 4.1 and 4.3 only, please. Thanks! 4.1 Write a recursive method int recLinearSearch (ArrayList list-new ArrayList(); // populate list with some Strings.. int idx
Java, 4.1 and 4.3 only, please. Thanks!

4.1 Write a recursive method int recLinearSearch (ArrayList list-new ArrayList(); // populate list with some Strings.. int idx - recLinearSearch (list, "some key", 0, list.size) - 1); Hint: the base case is reached when pBeginIdz is greater than pEndldr (what does this mean?). Otherwise, check to see if the element at pBeginldr is pKey. If it is, then return pBeginldx. If it is not, then make a recursive method call Suppose list is an ArrayList of Integers and contains these elements: list 2, 3, 5, 10, 16, 24, 32, 48, 96, 120, 240, 360, 800, 1600 and we call the recursive binary search method from the lecture notes: int idx recursiveBinarySearch(list, 10, 0, list.size) 1) 4.2 Trace the method and show the values of pLow and pHigh on entry to each method call. Show the value of pMiddle that is computed and state which clause of the if-elseif-elseif statement will be executed, .e., specify if return middle; will be executed, or if return recursiveBinarySearch(pList, pkey, pLo, middle - 1); will be executed, or if return recursiveBinarySearch(pList, pKey, middle + 1, ptigh); will be executed. Finally, at the end, specify the value assigned to index and the total number of times that recursive Binary Search) was called (including the original call) 4.3 Repeat Exercise 4.2 but this time let pkey be 150