View this code at http://livecoding.io/9222489
Created
February 26, 2014 02:39
-
-
Save benmak11/9222489 to your computer and use it in GitHub Desktop.
created by http://livecoding.io
This file contains 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
{ | |
"libraries": [], | |
"mode": "javascript", | |
"layout": "fullscreen mode (vertical)", | |
"resolution": "reset" | |
} |
This file contains 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
/* css goes here */ |
This file contains 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
<!-- html goes here --> |
This file contains 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
key = 'c'; | |
array = ['a', 'b', 'c', 'd']; | |
var low = 0; | |
var high = array.length - 1; | |
while (1) { | |
var mid = floor((low + high)/2); | |
var value = array[mid]; | |
if(value < key) { | |
low = mid + 1; | |
} | |
else if (value > key) { | |
high = mid - 1; | |
} | |
else { | |
return mid; | |
} | |
} |
This file contains 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
{} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment