This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.markdown-here-wrapper { | |
font-size: 16px; | |
line-height: 1.8em; | |
letter-spacing: 0.1em; | |
} | |
pre, code { | |
font-size: 14px; | |
font-family: Roboto, 'Courier New', Consolas, Inconsolata, Courier, monospace; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"sig":"a31fdfd7ba8d146e21dad4add1251c78f95060400a80c5a658c23244f232430c4b4c3e1a0029565574cbcb8e04e759b8cbffc0554b4cef4278923c9e1dcc4dd0","msghash":"d6558617d7d9b196d6c2649c741711cba4091266e7c33f009f1c6f1e688e7154"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def binary_search(arr, element) | |
arr.sort! | |
i = 0 | |
j = arr.length - 1 | |
puts binary(arr, i, j, element) | |
end | |
def binary(arr, i, j, element) | |
mid = (i + j) / 2 |