-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
56 lines (49 loc) · 1.33 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html>
<head>
<title>AlgoView</title>
<link rel="stylesheet" href="third-party/codemirror/lib/codemirror.css">
<link rel="stylesheet" href="main.css">
<script src="third-party/codemirror/lib/codemirror.js"></script>
<script src="third-party/codemirror/mode/javascript/javascript.js"></script>
<!-- <CodeMirror Plugins> -->
<script src="third-party/codemirror/lib/util/foldcode.js"></script>
<!-- </CodeMirror Plugins> -->
<script src="third-party/inherit.js"></script>
<script data-main="main" src="third-party/treehugger/lib/require.js"></script>
</head>
<body>
<div id="algoViewContainer">
<div class="float-wrap">
<div class="main-editor">
<button id="clearButton">Clear</button>
<textarea>function binarySearch (key, array) {
var low = 0;
var high = array.length - 1;
while (low <= high) {
var mid = Math.floor((low + high) / 2);
var value = array[mid];
if (value < key) {
low = mid + 1;
} else if (value > key) {
high = mid - 1;
} else {
return mid;
}
}
return -1;
}</textarea>
</div>
<div>
<div class="sample-input-editor">
<textarea>key = 4
array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]</textarea>
</div>
<div class="algo-view">
<textarea ></textarea>
</div>
</div>
</div>
</div>
</body>
</html>