{"version":"1.0","author_url":"https://blog.hatena.ne.jp/spider-man/","blog_title":"\u3059\u3071\u3044\u3060\u30fc\u65e5\u8a18\u3002","published":"2008-08-01 00:00:01","title":" \u4e8c\u5206\u63a2\u7d22(binary search)","provider_url":"https://hatena.blog","author_name":"spider-man","blog_url":"https://spider-man.hatenadiary.org/","url":"https://spider-man.hatenadiary.org/entry/20080801/p2","categories":["\u8cc7\u683c","\u57fa\u672c\u60c5\u5831"],"provider_name":"Hatena Blog","type":"rich","width":"100%","height":"190","image_url":null,"description":"Ruby \u3067\u5b9f\u88c5\u3057\u3066\u307f\u305f\u3051\u3069\u3061\u3087\u3063\u3068\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u3057\u307e\u3063\u305f\u3002\u305d\u3093\u306a\u81ea\u5206\u306b\u51f9\u307f\u3093\u3050\u3002 def binary_search(target , list , l , h) return -1 if l > h i = ((h - l) / 2).floor + l return i if target == list[i] if list[i] > target return binary_search(target , list , l , i -1) else return binary_search(target , list , i + 1, h ) end end \u307e\u3063\u3061\u3087\u306a\u30d6\u30ed\u30b0\u306e\u5b9f\u88c5\u3068\u2026","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fspider-man.hatenadiary.org%2Fentry%2F20080801%2Fp2\" title=\" \u4e8c\u5206\u63a2\u7d22(binary search) - \u3059\u3071\u3044\u3060\u30fc\u65e5\u8a18\u3002\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>"}