-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfundamental1.html
82 lines (68 loc) · 4.67 KB
/
fundamental1.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
<div class="mui--appbar-height"></div>
<div class="mui-container-fluid">
<br>
<h1>Fundamentals of Algorithmic Problem Solving</h1>
<img src="ramya/flowchart.png">
<h2>IMPORTANT PROBLEM TYPES</h2>
<p>In this section, we are going to introduce the most important problem types:</p>
<br>Sorting</br>
<p>The sorting problem is to rearrange the items of a given list in nondecreasing order.
As a practical matter, we usually need to sort lists of numbers, characters from an alphabet,
character strings, and, most important, records similar to those maintained by schools about
their students, libraries about their holdings, and companies about their employees. In the
case of records, we need to choose a piece of information to guide sorting. For example, we
can choose to sort student records in alphabetical order of names or by student number or by
student grade-point average. Such a specially chosen piece of information is called a key.</p>
<br>Searching</br>
<p>The searching problem deals with finding a given value, called a search key, in a
given set (or a multiset, which permits several elements to have the same value). There are
plenty of searching algorithms to choose from. They range from the straightforward
sequential search to a spectacularly efficient but limited binary search and algorithms based
on representing the underlying set in a different form more conducive to searching.</p>
<br>String processing</br>
<p>
String is a sequence of characters from an alphabet. Strings of particular interest are
text strings, which comprise letters, numbers, and special characters; bit strings, which
comprise zeros and ones; and gene sequences, which can be modeled by strings of characters
from the four-character alphabet {A,C, G, T}. One particular problem—that of searching for
a given word in a text—has attracted special attention from researchers. They call it string
matching.</p>
<br>Graph problems</br>
<p>
A graph can be thought of as a collection of points called vertices, some of which are
connected by line segments called edges. (A more formal definition is given in the next
section.) Graphs are an interesting subject to study, for both theoretical and practical reasons.
Graphs can be used for modeling a wide variety of applications, including transportation,
communication, social and economic networks, project scheduling, and games. Some graph
problems are computationally very hard; the most well-known examples are the traveling
salesman problem and the graph-coloring problem. The traveling salesman problem (TSP) is
the problem of finding the shortest tour through n cities that visits every city exactly once.
The graph-coloring problem seeks to assign the smallest number of colors to the vertices of a
graph so that no two adjacent vertices are the same color. This problem arises in several
applications, such as event scheduling: if the events are represented by vertices that areconnected by an edge if and only if the corresponding events cannot be scheduled at the same
time, a solution to the graph-coloring
problem yields an optimal schedule</P>
<br>Combinatorial problems</br>
<p>
From a more abstract perspective, the traveling salesman problem and the graph
coloring problem are examples of combinatorial problems. These are problems that ask,
explicitly or implicitly, to find a combinatorial object—such as a permutation, a combination,
or a subset—that satisfies certain constraints. A desired combinatorial object may also be
required to have some additional property such as a maximum value or a minimum cost</p>
<br>Geometric problems</br>
<p>Geometric algorithms deal with geometric objects such as points, lines, and polygons.
The ancient Greeks were very much interested in developing procedures (they did not call
them algorithms, of course) for solving a variety of geometric problems, including problems
of constructing simple geometric shapes—triangles, circles, and so on—with an unmarked
ruler and a compass. We will discuss algorithms for only two classic problems of
computational geometry: the closest-pair problem and the convex-hull problem. The closest-
pair problem is self-explanatory: given n points in the plane, find the closest pair among
them. The convex-hull problem asks to find the smallest convex polygon that would include
all the points of a given set.</p>
<br>Numerical problems</br>
<p>Numerical problems, another large special area of applications, are problems that
involve mathematical objects of continuous nature: solving equations and systems of
equations, computing definite integrals, evaluating functions, and so on. The majority of such
mathematical problems can be solved only approximately.</p>
<div class="mui-divider"></div>
</div>