-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
31 lines (31 loc) · 1.22 KB
/
index.html
File metadata and controls
31 lines (31 loc) · 1.22 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<main>
<section class="top">
<h1>Insertion Sort Algorithm</h1>
<ul id="list"></ul>
<button id="sort">Sort!</button>
</section>
<section class="section left">
<h2>What's the Big O?</h2>
<p>
The Big O notation of this sort algorithm is O(n<sup>2</sup>), because the runtime is relative to the input on the order of the square of the size of the input.
</p>
</section>
<section class="section right">
<h2>How does it work?</h2>
<p>
The insertion sort algorithm takes each list item (numbers in an array) and compares the number value to the value of the list item previous to it. If the value of the previous list item is greater than it, it will move itself before that number. The algorithm will continue with each list item, then stop running when the list is sorted from the lowest number to the highest in the array.
</p>
</section>
</main>
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="algorithm.js"></script>
</body>
</html>