-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbinary-search.html
More file actions
75 lines (75 loc) · 3.58 KB
/
binary-search.html
File metadata and controls
75 lines (75 loc) · 3.58 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Binary Search</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body id="binary-search">
<div id="wrapper">
<header>
<div class="container clearfix">
<h1>
<a class="gear" href="index.html" title="Home">
<img alt="gear" src="gear.png">
</a>
</h1>
<h1 class="title">Discrete Structures Tutorials</h1>
<nav>
<ul id="topbar">
<li><a class="navlink" href="index.html">Home</a></li>
<li><a class="navlink" href="binary-search.html">Binary Search</a></li>
<li><a class="navlink" href="about.html">About</a></li>
<li><a class="navlink" href="references.html">References</a></li>
</ul>
</nav>
</div>
</header>
<main>
<div class="container">
<div class="row">
<div class="midcolumn">
<aside class="sidebar">
<ul class="mainmenu">
<li class="heading">Content</li>
<li><a class="sidelink" href="relation.html">What is a Relation?</a></li>
<li><a class="sidelink" href="properties.html">Properties of Relations</a></li>
<li><a class="sidelink" href="tables.html">Relations as Tables</a></li>
<li><a class="sidelink" href="graphs.html">Relations as Graphs</a></li>
<li><a class="sidelink" href="examples.html">Examples</a></li>
</ul>
</aside>
</div>
<div class="row">
<div class="content">
<div class="midcolumn2">
<!-- Main Content -->
<div class="heading">
<h1>Relations Tutorial - Binary Search</h1>
<h4>by David Muñoz and Will Ptacek</h4>
</div>
<div class="ptext">
<p>A binary search searches through a sorted array by repeatedly dividing the array in
half. If the value of the search term is less than the middle value of the array,
then the lesser half becomes the “new array.” If not, then the upper half becomes
the “new array.” This is repeatedly done until there are only two values left, at
which point the search term is either one of the two values.
</p>
<p class="pic">
<img height="300" width="500" src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/13/Noisy_binary_search.svg/2560px-Noisy_binary_search.svg.png">
</p>
<p>As it is more efficient than a linear search, binary searches are commonly used
whenever data is sorted.</p>
</div>
</div>
<div class="row">
<div class="midcolumn3" id="rightbar"></div>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
</body>
</html>