python data structures recursion allows function to call itself fixed steps of code get executed again and again for new values we also have to set criteria for deciding when the recursive call ends in the below example we see recursive approach to the binary search we take sorted list and give its index range as input to the recursive function binary search using recursion we implement the algorithm of binary search using python as shown below we use an ordered list of items and design recursive function to take in the list along with starting and ending index as input thenthe binary search function calls itself till find the searched item or concludes about its absence in the list def bsearch(listidx idxnval)if (idxn idx )return none elsemidval idx ((idxn idx / compare the search item with middle most value if list[midvalvalreturn bsearch(listidx midval- ,valelif list[midvalvalreturn bsearch(listmidval+ idxnvalelsereturn midval list [ , , , , , print(bsearch(list )print(bsearch(list )when the above code is executedit produces the following result none