Question: / * * * This method determines whether an element is in the list or not. * In the process of searching the list, it
This method determines whether an element is in the list or not.
In the process of searching the list, it will keep a tally of comparisons ie steps it makes
to find the given element. It returns a Pair containing a boolean, which expresses whether the
element was found true or not false and an integer value showing the number of comparisons it took
@param e element to be search for in the list
@return pair containing a boolean and int. Boolean should be true if element is found. False otherwise.
The number of comparisouns made to reach either conclusion is the integer
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
