forked from cooervo/Algorithms-DataStructures-BigONotation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintro.html
155 lines (128 loc) · 5.49 KB
/
intro.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css/style.css">
<link
href='http://fonts.googleapis.com/css?family=Open+Sans:800|Titillium+Web:400,600,700,900'
rel='stylesheet' type='text/css'>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1">
<title>Algorithms and Data Structures</title>
<link rel="icon" href="images/icons/favicon.ico">
</head>
<body>
<!-- ======== ASIDE ======== -->
<aside>
<a href="index.html"><img id="logo"
src="images/logo-algos.svg"
onerror="this.onerror=null; this.src='image.svg'"></a>
<a id="menu-button" href="#">Menu</a>
<nav id="responsive-nav">
<ul>
<li><a href="index.html"><img class="aside-icons"
src="images/icons/cheat-sheets.svg"
onerror="this.onerror=null; this.src='image.svg'">big O cheat sheets</a></li>
<li><a href="intro.html"><img class="aside-icons"
src="images/icons/intro-icon.svg"
onerror="this.onerror=null; this.src='image.svg'">intro</a></li>
<li><a href="big-O-notation.html"><img
class="aside-icons" src="images/icons/big-o-icon.svg"
onerror="this.onerror=null; this.src='image.svg'">big O notation</a></li>
<li><a href="data-structures.html"><img
class="aside-icons"
src="images/icons/data-structures-icon.svg"
onerror="this.onerror=null; this.src='image.svg'"><span
class="nav-descriptions">data structures</span></a></li>
<li><a href="algorithms.html"><img
class="aside-icons" src="images/icons/algo-icon.svg"
onerror="this.onerror=null; this.src='image.svg'"><span
class="responsnav-descriptionsive-hide">algorithms</span></a></li>
<li><a
href="https://github.com/cooervo/algortihms-datastructures"
target="_blank"><img class="aside-icons"
src="images/icons/github.svg"
onerror="this.onerror=null; this.src='image.svg'"><span
class="nav-descriptions">Github</span></a></li>
</ul>
</nav>
<div id="share-div">
<ul id="share-list">
<li><a
href="https://www.facebook.com/sharer/sharer.php?u=http://cooervo.github.io/algortihms-datastructures/index.html"><img
class="share-buttons" src="images/icons/FB-share.svg"
onerror="this.onerror=null; this.src='image.svg'"></a></li>
<li><a
href="https://twitter.com/home?status=Check%20this%20website%20with%20%20cheatsheets%20for%20data%20structures%20and%20algorithms%20http://cooervo.github.io/algortihms-datastructures/index.html"><img
class="share-buttons"
src="images/icons/twitter-share.svg"
onerror="this.onerror=null; this.src='image.svg'"></a></li>
<li><a
href="https://plus.google.com/share?url=http://cooervo.github.io/algortihms-datastructures/index.html"><img
class="share-buttons"
src="images/icons/google-plus-share.svg"
onerror="this.onerror=null; this.src='image.svg'"></a></li>
</ul>
</div>
</aside>
<!-- ======== MAIN ======== -->
<div id="main">
<article>
<h1 class="titles">WHAT IS AN ALGORITHM?</h1>
<p>The best definition of algorithms that I have come
across is the following:</p>
<p>
<b>Algorithms are a series of steps or rules for solving
a computational problem.</b>
</p>
<p>
A <b>computational problem</b> is a collection of questions
that computers might be able to solve.
</p>
<p>An example of a simple algorithm could be one used by a
coffee maker, it might look something like this:</p>
<div class="code-div">
<pre>
<code class="Jcode">
if (clock.getTime() == 7am){
coffeMaker.boilWater();
if(water.isBoiled()){
coffeMaker.addCoffee();
coffeMaker.pourCoffee();
}
} else{
coffeMaker.doNothing();
}
</code>
</pre>
</div>
<div class="division"></div>
</article>
<article>
<h1 class="titles">ALGORITHM EFFICIENCY</h1>
<p>Algorithm efficiency is the study of the amount of
resources used by an algorithm. The less resources used by
the algorithm the more efficient it is. Nevertheless, to
have a good comparison between different algorithms we can
compare based on the resources it uses: how much time it
needs to complete, how much memory it uses to solve a
problem or how many operations it must do in order to solve
the problem</p>
<p>
<b>Time efficiency:</b> a measure of amount of time an
algorithm takes to solve a problem.
</p>
<p>
<b>Space efficiency:</b> a measure of the amount of memory
an algorithm needs to solve a problem.
</p>
<p>
<b>Complexity theory:</b> a study of algorithm performance
based on cost functions of statement counts.
</p>
<div class="division"></div>
</article>
</div>
<script src="js/jquery-1.11.2.min.js"></script>
<script src="js/script.js"></script>
</body>
</html>