(defn binary-search [coll value] (let [pred #(< % value)] (->> coll (map #(if (pred %) -1 1)) (reduce (fn [acc x] (+ acc x)) 0) (filter #(not= % 0)) first)))
To embed this program on your website, copy the following code and paste it into your website's HTML: