4. Function Two: myLSearch Specification: Assume you are given a sorted list of
ID: 3721335 • Letter: 4
Question
4. Function Two: myLSearch Specification: Assume you are given a sorted list of integers to search. Your job is to write a search algorithm to find the index of a particular number Page 2 of 3 CS 105 Intro to Computing Non-Tech The second function you will write should be called myLSearch'. Your function should take two (2) arguments: an integer to search for and a sorted list of integers. The function should return one (1) integer, the index in the input containing the input integer. If the input integer does not exist in the list, your function should return -1. For credit, you MUST use either a for or a while loop. This search algorithm should NOT be recursive. There should be no call to itself in the body of the function or you will get no credit. Spring 2018 5. Function Three: myRSearch Assume you are given a sorted list of integers to search. Your job is to write a search algorithm to find the index of a particular number The third function you will write should be called myRSearch Your function should take two (2) arguments: an integer to search for and a sorted list of integers. The function should return one (1) integer, the index in the input list containing the input integer. If the input integer does not exist in the list, your function should return -1 For credit, you MUST NOT use either a for or a while loop. This search algorithm MUST be recursive There should be at least one call to itself in the body of the function or you will get no creditExplanation / Answer
**Comment for any further queries.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.