Search algorithm #2: Binary Search  Example : To search for 19 in the list. 1 2 3 5 6 7 8 10 12 13 15 16 18 19 20 22. First split this list, which ha
{"Image DocumentName": "Search algorithm #2: Binary Search", "Image ImageDescription": "The pseudocode for the binary search algorithm. n is the number of integers in the list. procedure binary search(x:integer, a1, a2, \u2026, an: distinct integers) i := 1 {left endpoint of search interval} j := n {right endpoint of search interval} while i < j begin {while interval has >1 item} m := \uf0eb(i + j ) /2\uf0fb {midpoint} if x > am then i := m+1 else j := m end if x = ai then location := i else location := 0 return location.", "Image XResolution": "37", "Image YResolution": "37", "Image ResolutionUnit": "Pixels/Centimeter", "Image Software": "SlidePlayer", "Image YCbCrPositioning": "Centered"}