📖 generic · 12th TN - English Medium · COMPUTER SCIENCE · Page 37definition

ALGORITHMIC STRATEGIES · Part 8

Chapter 2: 3 · COMPUTER SCIENCE

12th Computer Chapter - - Now compare the search element with the value stored at mid value location . The value stored at location or index is , which is not match with search element. As the search value is greater than . Now we change our low to mid + and find the new mid value again using the formula.

low = mid + mid = low + (high - low) / Our new mid is now. We compare the value stored at location with our target value . The value stored at location or index is not a match with search element, rather it is more than what we are looking for. So, the search element must be in the lower part from the current mid value location The search element still not found.

Hence, we calculated the mid again by using the formula. high = mid - mid = low + (high - low)/ Now the mid value is . Now we compare the value stored at location with our search element. We found that it is a match.

We can conclude that the search element is found at lcoation or index . For example if we take the search element as , For this value this binary search algorithm return unsuccessful result. Sorting Techniques . .

. Bubble sort algorithm Bubble

Related topics

Have a question about this topic?

Get an AI answer grounded in your actual textbook — with the exact page reference.

Ask AI about this topic →