Question: 3 . 2 . 1 : Recursive algorithm: search. String query _ item and a list of alphabetically sorted strings are read from input. Complete
: Recursive algorithm: search. String queryitem and a list of alphabetically sorted strings are read from input. Complete the search function:
If queryitem is found at index midindex of the list, output queryitem, followed by is found at index and the value of midindex.
Else if rangesize is output queryitem, followed by is not in the list'.
Otherwise, output queryitem, followed by is not found at index and the value of midindex.
def searchallnames, queryitem, minindex, maxindex:
rangesize maxindex minindex
midindex minindex maxindex
Your code goes here
queryitem input
datalist inputsplit
searchdatalist, queryitem, lendatalist
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
