Information Technology Reference
In-Depth Information
spreadsheet) that allows us to do the job directly. Similarly, if we
owe money on our credit card, we may want to compute our new
balance after making this month's payment and then adding the in
terest that the creditcard company will charge us. Again, a simple
calculator or spreadsheet may resolve our problem.
Unfortunately, relatively few problems are that simple. When
we're working with complex problems, a helpful general approach
is to break down our initial large problem and identify appropriate
smaller ones. If we can solve the small ones, then we can put the
pieces together to get our answer to the initial problem.
As an example, suppose we want to know our creditcard bal
ance and the interest paid for each month until our debt is paid off—
assuming we make the same monthly payments. We already have
noted that we could use a calculator or spreadsheet to handle this
task for a single month. Our next step might be to incorporate those
calculations into a program that repeats this process until our debt is
cleared. Such a process is called repetition , and computers are partic
ularly good at this type of task. In repetition, we typically need to or
ganize our data in a methodical way, and then we apply the compu
tations systematically to the information we have stored. For
example, in computing credit balances, we may organize our work
in a table, with one row in the table giving the starting balance, pay
ment, interest rate, interest, and final balance for a month. Successive
rows would provide the information for successive months. In com
puting, data organized together in a logical manner is called a data
structure , and much algorithm development focuses on identifying
appropriate data structures and organizing their methodical process
ing to obtain the desired results. Our example actually involves two
data structures: one containing the data for a row, and the second in
volving the entire table that has the rows as components.
In developing algorithms, we frequently begin by dividing a
complex problem into subproblems in such a way that we would
have the answer to the initial, large problem if we could answer
each of the subproblems. We then try to solve the subproblems fol
lowing the same strategy. Sometimes we may be able to solve a sub
problem directly, but often that too may need further subdivision.
As an analogy, you may note that this approach to problem solving
matches reasonably well with the notion of outline form. In an out
line, the main points are identified as points I, II, III, and so on.
Often one of these main points is expanded with subpoints A, B, C
Search WWH ::




Custom Search