-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
255 lines (236 loc) · 11.7 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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>techAVblog</title>
<link rel="stylesheet" href="style/styles.scss">
<link rel="icon" href="favicon.ico">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@200;300&display=swap" rel="stylesheet">
<body>
<div class="blank">
<div class ="home">
<h2>techAVblog</h2>
</div>
<div class="contact-me">
<h2></h2>
</div>
</div>
<div>
<h1 class="title">DATA STRUCTURE AND ALGORITHAM</h1>
</div>
<div class="java">
<h1></h1>
</div>
<h2 class="title">What are data structures & algorithms?</h2>
<p>The term data structure is used to describe how the data is stored and the algorithm is
used to describe how data is pressed, both data and algorithm are irrelated to each other,
Where Data structure is nothing but a representation of the logical relationship between each
element of the data. In other words, a data structure helps you organize all the data items
that consider the way data elements are stored and their relationship to one another. </p>
<p>
The algorithm is a finite set of instructions,
which is used toaccomplish a particular task.
Each of which has a clear meaning and can be
performed with a finite number of efforts by a
finite length of time. The best thing about the algorithm is that it doesn’t
matter what input values may be,
the algorithm terminates after executing a finite number of instructions.
</p>
<p><b>The data structure can be represented as: </b></p>
<p id="algo">Algorithm + Data structure= program</p>
<h2 class="title">What are ALGORITHM</h2>
<p>
An algorithm is a step-by-step process,
which is to be followed when writing an algorithm
to define a set of instructions in a certain order
to get the output, algorithm can be written in more
than one programming language. According to the data structure,
some of the important categories of the algorithm are,
</p>
<ul class="title">
<li>Insert- an element is inserted in the data structure</li>
<li>Sort- element is sorted (arranged) in a certain order in the data structure</li>
<li>Search- an element is searched in the data structure</li>
<li>Delete- an element is deleted in the data structure</li>
<li>Update- element is updated in the data structure</li>
</ul>
<h2 class="title">HOW TO WRITE AN ALGORITHM</h2>
<p>
Well, there is no well-defined structure for
writing an algorithm. Algorithms are never written
to be code for any particular programming language.
We may know that all programming language(s) share
some of the basic code constructures,
like flow-control (if, else); loops (for, do, while),
etc. these common
constructure can help you in writing an algorithm.
</p>
<p>
We know that we write an algorithm in step-by-step
order but, it is not in all cases. Writing an
algorithm is the process of execution after the
problem domain is well defined. Before you begin
writing an algorithm you must know the main problem domain,
for which you are about to design the solution.
</p>
<p>Some of the examples are given to understand more about how to write an algorithm:</p>
<h3 class="title">EXAMPLE 1</h3>
<p><b>Write an algorithm to add 2 numbers,</b></p>
<p>
<b>STEP 1 -</b> start <br>
<b>STEP 2 -</b> read a, b <br>
<b>STEP 3 -</b> sum a+b <br>
<b>STEP 4 -</b> print <br>
<b>STEP 5 -</b> stop <br>
</p>
<h3 class="title">EXAMPLE 2</h3>
<p><b>Check the eligibility of getting driving licence</b></p>
<p>
<b>STEP 1 -</b> start <br>
<b>STEP 2 -</b> read age <br>
<b>STEP 3 -</b> if age >= 18 then go to step_4 else step_5 <br>
<b>STEP 4 -</b> writ “The person is eligible to get driving licences” <br>
<b>STEP 5 -</b> writ “The person is not eligible to get driving licences” <br>
<b>STEP 6 -</b> Stop
</p>
<p>
It is not necessarily that one must write an algorithm
in the same way as mentioned above, the algorithm tells
the programmer how to code to the given problem domain
effectively. Moreover, we design algorithms to get the
solution to a given problem.
The problem can be solved in more than one way.
</p>
<br>
<h2 class="title">PERFORMANCE OF ALGORITHM</h2>
<p>The efficiency of the algorithm is mostly dependent on</p>
<ul class="title">
<li>Time complexity</li>
<li>Space complexity.</li>
</ul>
<h3 class="title">TIME COMPLEXITY:</h3>
<p>
The amount of time required for the algorithm to
complete its execution is the time complexity.
An algorithm is said to be efficient if it takes a
minimum(reasonable)
amount of time to complete the execution.
</p>
<h3 class="title">SPACE COMPLEXITY:</h3>
<p>
It’s the space occupied by the algorithm is known as
space complexity. An algorithm is said to be efficient
if it takes less space and
required less amount of time to complete its execution.
</p>
<h2 class="title">ASYMPTOTIC NOTATIONS</h2>
<p>
Asymptotic analysis is the algorithm that
refers to defining the mathematical bounding/framing
of its run time. Asymptotic helps you to find the best, average, worst, case scenario of an algorithm. Asymptotic analysis refers to the computing time of any operation
in a mathematical unit of computation.
</p>
<p>
For example, the running time of one operation is
computed as f(n) and another operation took to compute
g(n^2). This means that the first operation running
time will increase linearly with the increase in n and
the running time of the second operation will increase
exponentially when n is increased.
</p>
<p>
The time required to compute by the algorithm fall under three (3) categories:
</p>
<ul class="title">
<li> <b> O NOTATION (Best case) –</b> minimum time required for the execution of the program</li>
<li> <b>Ω NOTATION (Average case) - </b> average time required for the execution of the program</li>
<li> <b>Θ NOTATION (Worst case) – </b> maximum time required for the execution of the program.</li>
</ul>
<h2 class="title">Why do we need to study DSA?</h2>
<p>
In this, we will learn why one should learn Data
structure and algorithm (DSA), by learning Data
structure and algorithm (DSA) you can understand
the concept of the data and how to store the data in
a way that can be found easily so that the user doesn’t
face any problem finding out the data. As the
applications are getting big and complex and increase
in data, there are three (3)
commonly problems that may occur in the application
</p>
<ol class="title">
<li>Data search</li>
<li>Processor speed</li>
<li>Multiple requests</li>
</ol>
<p>
To overcome this problem, we use data structures in
this Data structure and algorithm (DSA) we will see
the time and space complexity of the code and the best
possible way to store the data.
There are a few ways by which you can store the data,
</p>
<ul class="title">
<li>Array</li>
<li>Stacks and queues</li>
<li>Linked list</li>
<li>Trees</li>
<li>Graphs</li>
<li>Selection and sorting.</li>
</ul>
<img src="pdf/graph.png" alt="" class="title" id="flow">
<h2 class="title">ARRAY:</h2>
<p>
An array is a type of data structure that stores
homogeneous elements in a memory location which are
contiguous. The main concept of an array is to store
multiple data in one location where each data is stored together
to save memory and time to search the data. The data
(or) objects which are of the same type are stored in
the same order in the array. The size of the array
needs to be defined before the data is stored in the
array. Any data stored in the array can be accessed
and modified easily. The data which are stored in the
array are given a subject (or)
index to identify the location of the data stored.
</p>
<h3 class="title">EXAMPLE:</h3>
<img src="pdf/array.png" alt="" class="title" id="aray">
<br> <br>
<p>
let’s, store the marks of 20 students, then the size
of an array has to be mentioned as 20. Then the
student's marks can then be stored in the created
array without creating separate variables for marks
for every student. A Simple traversal
of an array could be done to access the elements.
</p>
<h2 class="title">STACK</h2>
<p>
A stack is a linear data structure, where elements
are inserted and deleted only from one end, that is
the top of the stack. Stack follows the principle of
LIFO (last in first out). The elements which are last
in the stack will be deleted first as the elements can
only be added from the top. So, the element which is added
last will be the one that needs to be removed first.
</p>
<p>
The best example to understand the stack properties
would be arranging the books according to their Roll
number where the first roll number’s book goes at the
bottom and the book of the last roll number is placed
at the top. And if the books need to be distributed to
students again the first book goes to the last roll
number person. the items can only be added or removed
only from the top that is the last item to
be added to a stack will be removed first from the stack.
</p>
<div class="b2">
<p id="rights" class="title">©coppy rights</p>
</div>
</body>
</html>