; reluctant search
(define (research x xs i j)
(if (> i j)
-1
(if (= i j)
(if (= x (vector-ref xs i))
i
-1)
(let ((m (quotient (+ i j) 2)))
(if (<= x (vector-ref xs m))
(let ((k (research x xs (+ m 1) j)))
(if (= k -1)
(research x xs i m)
k)))
(let ((k (research x xs i m)))
(if (= k -1)
(research x xs (+ m 1) j)
k))))))
(display (research 3 '#(1 2 3 5 6) 0 4)) (newline)
(display (research 4 '#(1 2 3 5 6) 0 4)) (newline); your code goes here