Alogorithm & Prolem Solving
Alogorithm & Prolem Solving
SOLVING
What Is Computer Science?
Computer science is difficult to define. This is probably due to the unfortunate use of the word
“computer” in the name. As you are perhaps aware, computer science is not simply the study of
computers. Although computers play an important supporting role as a tool in the discipline,
they are just that–tools.
Computer science is the study of problems, problem-solving, and the solutions that come out of
the problem-solving process. Given a problem, a computer scientist’s goal is to develop
an algorithm, a step-by-step list of instructions for solving any instance of the problem that
might arise. Algorithms are finite processes that if followed will solve the problem. Algorithms
are solutions.
In other Words
Certain logical instructions must be given for the programming of a computer. Sets of logical
instructions will only be created for a computer if the programmer assumes that the
instructions are interpreted by a computer. Computational thought is a process of thinking that
is engaged in the formulation and solution of a problem in a way which computers can achieve
effectively.
These defects are seldom due to carelessness by the client. Instead, they are because natural
languages (English, French, Korean, etc.) are rather imprecise. Part of the developer's
responsibility is to identify defects in the description of a problem and to work with the client to
remedy those defects.
When determining the starting point, we should start by seeking answers to the following
questions:
When determining the ending point, we need to describe the characteristics of a solution. In
other words, how will we know when we're done? Asking the following questions often helps to
determine the ending point.
What new facts will we have?
What items will have changed?
What changes will have been made to those items?
What things will no longer exist?
Analysis: I don't have a card. I prefer to buy a card rather than make one myself.
High-level algorithm:
This algorithm is satisfactory for daily use, but it lacks details that would have to be added were
a computer to carry out the solution. These details include answers to questions such as the
following.
These kinds of details are considered in the next step of our process .
When our goal is to develop algorithms that will lead to computer programs, we need to
consider the capabilities of the computer and provide enough detail so that someone else could
use our algorithm to write a computer program that follows the steps in our algorithm. As with
the birthday card problem, we need to adjust the level of detail to match the ability of the
programmer. When in doubt, or when you are learning, it is better to have too much detail than
to have too little.
Most of our examples will move from a high-level to a detailed algorithm in a single step, but
this is not always reasonable. For larger, more complex problems, it is common to go through
this process several times, developing intermediate-level algorithms as we go. Each time, we
add more detail to the previous algorithm, stopping when we see no benefit to further
refinement. This technique of gradually working from a high-level to a detailed algorithm is
{Does this algorithm solve a very specific problem or does it solve a more general
problem? If it solves a very specific problem, should it be generalized?}
For example, an algorithm that computes the area of a circle having a radius of 5.2 meters
(formula π*5.22) solves a very specific problem, but an algorithm that computes the area of any
circle (formula π*R2) solves a more general problem.
Is this solution similar to the solution to another problem? How are they alike? How are they
different?
Differences: Different measurements are used. The triangle formula contains 0.5.